From: Michael Wallner Date: Wed, 16 Apr 2014 18:12:18 +0000 (+0200) Subject: fix tests X-Git-Tag: RELEASE_2_0_7~30 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=d49a97b2b3ab695ec0fc0c855757f9a5e5e94009;p=m6w6%2Fext-http fix tests --- diff --git a/tests/client010.phpt b/tests/client010.phpt index 7563a77..803403f 100644 --- a/tests/client010.phpt +++ b/tests/client010.phpt @@ -8,29 +8,32 @@ include "skipif.inc"; getBody()->addForm(null, array("file"=>__FILE__, "name"=>"upload", "type"=>"text/plain")); - -foreach (http\Client::getAvailableDrivers() as $driver) { - $client = new http\Client($driver); - $client->enqueue($request)->send(); - var_dump($client->getResponse()->getBody()->toString()); -} -?> -Done ---EXPECTREGEX-- -Test -(?:string\(\d+\) "Array +$RE = +'/(Array \( \[upload\] \=\> Array \( \[name\] \=\> client010\.php \[type\] \=\> text\/plain - \[tmp_name\] \=\> .* + \[tmp_name\] \=\> .+ \[error\] \=\> 0 \[size\] \=\> \d+ \) \) -" -)+Done +)+/'; +$request = new http\Client\Request("POST", "http://dev.iworks.at/ext-http/.print_request.php"); +$request->getBody()->addForm(null, array("file"=>__FILE__, "name"=>"upload", "type"=>"text/plain")); + +foreach (http\Client::getAvailableDrivers() as $driver) { + $client = new http\Client($driver); + $client->enqueue($request)->send(); + if (!preg_match($RE, $s = $client->getResponse()->getBody()->toString())) { + echo($s); + } +} +?> +Done +--EXPECT-- +Test +Done \ No newline at end of file diff --git a/tests/envresponse003.phpt b/tests/envresponse003.phpt index 3bbf760..7a02814 100644 --- a/tests/envresponse003.phpt +++ b/tests/envresponse003.phpt @@ -18,7 +18,7 @@ $r->setBody(new http\Message\Body(fopen(__FILE__, "rb"))); $r->send(); ?> ---EXPECTHEADERS-- -Content-Type: text/plain +--EXPECTHEADERSF-- +Content-Type: text/plain%s --EXPECTF-- php diff --git a/tests/envresponseheader001.phpt b/tests/envresponseheader001.phpt index 194f7d7..e03320f 100644 --- a/tests/envresponseheader001.phpt +++ b/tests/envresponseheader001.phpt @@ -34,6 +34,6 @@ Array [2] => good ) - [Content-Type] => text/html + [Content-Type] => text/html%s ) Created diff --git a/tests/etag001.phpt b/tests/etag001.phpt index b3a2a53..c1e1e44 100644 --- a/tests/etag001.phpt +++ b/tests/etag001.phpt @@ -11,7 +11,12 @@ version_compare(PHP_VERSION, "5.4.0", ">=") or die("skip PHP>=5.4 required"); $body = new http\Message\Body; $body->append("Hello, my old fellow."); foreach (hash_algos() as $algo) { - if ($algo == "gost-crypto") continue; + switch ($algo) { + case "gost-crypto": + case "fnv1a32": + case "fnv1a64": + continue 2; + } ini_set("http.etag.mode", $algo); printf("%10s: %s\n", $algo,