fix tests
authorMichael Wallner <mike@php.net>
Wed, 16 Apr 2014 18:12:18 +0000 (20:12 +0200)
committerMichael Wallner <mike@php.net>
Wed, 16 Apr 2014 18:12:18 +0000 (20:12 +0200)
tests/client010.phpt
tests/envresponse003.phpt
tests/envresponseheader001.phpt
tests/etag001.phpt

index 7563a7760246250be341a47de3c248e6c74e9d81..803403f4686366fb78fc83728b07f39cdcb908a6 100644 (file)
@@ -8,29 +8,32 @@ include "skipif.inc";
 <?php
 echo "Test\n";
 
-$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();
-       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
index 3bbf760c7dc77b69ce8212358504ec682f7ac77e..7a02814c27c5b5ea60ecfbeee42ba1c917ecb5da 100644 (file)
@@ -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
index 194f7d78f811928b4440eb55d94320c2835caebe..e03320fc1ce121d1159faef9ef7ba7683a497dc2 100644 (file)
@@ -34,6 +34,6 @@ Array
             [2] => good
         )
 
-    [Content-Type] => text/html
+    [Content-Type] => text/html%s
 )
 Created
index b3a2a5347fbe4207dc2425604e578a8e88805e96..c1e1e44c897a92587198dcab8fd16bb1bf156703 100644 (file)
@@ -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,