From d49a97b2b3ab695ec0fc0c855757f9a5e5e94009 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Wed, 16 Apr 2014 20:12:18 +0200 Subject: [PATCH] fix tests --- tests/client010.phpt | 35 ++++++++++++++++++--------------- tests/envresponse003.phpt | 4 ++-- tests/envresponseheader001.phpt | 2 +- tests/etag001.phpt | 7 ++++++- 4 files changed, 28 insertions(+), 20 deletions(-) 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, -- 2.30.2