travis
[m6w6/ext-raphf] / tests / http003.phpt
index 996f4d7f350bca6146e2a906c94bf07eedbe5186..671b8d4ce9bd11f5bc8ca557f12688a142fcb0a6 100644 (file)
@@ -13,27 +13,30 @@ if (!class_exists("http\\Client", false)) {
 <?php
 echo "Test\n";
 
-$c = new http\Client("curl", "php.net:80");
+$c = new http\Client("curl", "PHP");
 do {
        $c->enqueue(new http\Client\Request("GET", "http://php.net"));
 } while (count($c) < 3);
 
 unset($c);
 
-var_dump(raphf\stat_persistent_handles());
+$h = (array) raphf\stat_persistent_handles();
+var_dump(array_intersect_key($h, array_flip(preg_grep("/^http/", array_keys($h)))));
 
-raphf\clean_persistent_handles(null, "php.net:80");
+raphf\clean_persistent_handles(null, "PHP");
+raphf\clean_persistent_handles(null, "PHP:php.net:80");
 
-var_dump(raphf\stat_persistent_handles());
+$h = (array) raphf\stat_persistent_handles();
+var_dump(array_intersect_key($h, array_flip(preg_grep("/^http/", array_keys($h)))));
 
 ?>
 Done
 --EXPECTF--
 Test
-object(stdClass)#%d (2) {
+array(2) {
   ["http\Client\Curl"]=>
   array(1) {
-    ["php.net:80"]=>
+    ["PHP"]=>
     array(2) {
       ["used"]=>
       int(0)
@@ -43,7 +46,7 @@ object(stdClass)#%d (2) {
   }
   ["http\Client\Curl\Request"]=>
   array(1) {
-    ["php.net:80"]=>
+    ["PHP:php.net:80"]=>
     array(2) {
       ["used"]=>
       int(0)
@@ -52,10 +55,10 @@ object(stdClass)#%d (2) {
     }
   }
 }
-object(stdClass)#%d (2) {
+array(2) {
   ["http\Client\Curl"]=>
   array(1) {
-    ["php.net:80"]=>
+    ["PHP"]=>
     array(2) {
       ["used"]=>
       int(0)
@@ -65,7 +68,7 @@ object(stdClass)#%d (2) {
   }
   ["http\Client\Curl\Request"]=>
   array(1) {
-    ["php.net:80"]=>
+    ["PHP:php.net:80"]=>
     array(2) {
       ["used"]=>
       int(0)