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 7563a77..803403f 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 3bbf760..7a02814 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 194f7d7..e03320f 100644 (file)
@@ -34,6 +34,6 @@ Array
             [2] => good
         )
 
-    [Content-Type] => text/html
+    [Content-Type] => text/html%s
 )
 Created
index b3a2a53..c1e1e44 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,