release dev10
[m6w6/ext-http] / tests / persistenthandles001.phpt
index dd7b8c7047c56fe5974c204f5436ca4521aaa871..01f5069bea86b75e511a9aaa3f09d3e7838b89f5 100644 (file)
@@ -4,32 +4,26 @@ persistent handles
 <?php include "skipif.inc"; ?>
 --FILE--
 <?php
-(new http\Request\Factory(array("persistentHandleId" => "foo")))
-    ->createRequest("http://dev.iworks.at")
+(new http\Client\Factory(array("persistentHandleId" => "foo")))
+    ->createClient()->setRequest(new http\Client\Request("GET", "http://dev.iworks.at"))
     ->setOptions(array("connecttimeout"=> 90, "timeout" =>300))
-    ->send(); 
-$r = (new http\Request\Factory(array("persistentHandleId" => "bar")))
-    ->createRequest("http://dev.iworks.at")
+    ->send(null); 
+$r = (new http\Client\Factory(array("persistentHandleId" => "bar")))
+    ->createClient()->setRequest(new http\Client\Request("GET", "http://dev.iworks.at"))
     ->setOptions(array("connecttimeout"=> 90, "timeout" =>300));
     
 var_dump(http\Env::statPersistentHandles()); 
 http\Env::cleanPersistentHandles(); 
 var_dump(http\Env::statPersistentHandles());
 
-$r->send();
+$r->send(null);
 
 var_dump(http\Env::statPersistentHandles());
 ?>
 DONE
 --EXPECTF--
 object(stdClass)#%d (3) {
-  ["http_request_datashare.curl"]=>
-  array(0) {
-  }
-  ["http_request_pool.curl"]=>
-  array(0) {
-  }
-  ["http_request.curl"]=>
+  ["http_client.curl"]=>
   array(2) {
     ["foo"]=>
     array(2) {
@@ -46,15 +40,15 @@ object(stdClass)#%d (3) {
       int(0)
     }
   }
-}
-object(stdClass)#%d (3) {
-  ["http_request_datashare.curl"]=>
+  ["http_client_pool.curl"]=>
   array(0) {
   }
-  ["http_request_pool.curl"]=>
+  ["http_client_datashare.curl"]=>
   array(0) {
   }
-  ["http_request.curl"]=>
+}
+object(stdClass)#%d (3) {
+  ["http_client.curl"]=>
   array(1) {
     ["bar"]=>
     array(2) {
@@ -64,15 +58,15 @@ object(stdClass)#%d (3) {
       int(0)
     }
   }
-}
-object(stdClass)#%d (3) {
-  ["http_request_datashare.curl"]=>
+  ["http_client_pool.curl"]=>
   array(0) {
   }
-  ["http_request_pool.curl"]=>
+  ["http_client_datashare.curl"]=>
   array(0) {
   }
-  ["http_request.curl"]=>
+}
+object(stdClass)#%d (3) {
+  ["http_client.curl"]=>
   array(1) {
     ["bar"]=>
     array(2) {
@@ -82,5 +76,11 @@ object(stdClass)#%d (3) {
       int(0)
     }
   }
+  ["http_client_pool.curl"]=>
+  array(0) {
+  }
+  ["http_client_datashare.curl"]=>
+  array(0) {
+  }
 }
 DONE