X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=tests%2Fpersistenthandles001.phpt;h=18bce8a6b9b87bfc3400eafa75bd10b36502df09;hb=6519517dbcc5d55117b3fa94572fe93123ddfe56;hp=dd7b8c7047c56fe5974c204f5436ca4521aaa871;hpb=a84a30daa74ea8ff52a671769528ccf06580be4e;p=m6w6%2Fext-http diff --git a/tests/persistenthandles001.phpt b/tests/persistenthandles001.phpt index dd7b8c7..18bce8a 100644 --- a/tests/persistenthandles001.phpt +++ b/tests/persistenthandles001.phpt @@ -4,32 +4,26 @@ persistent handles --FILE-- "foo"))) - ->createRequest("http://dev.iworks.at") +$f = new http\Client\Factory(array("persistentHandleId" => "foo")); +$r = $f->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); +$f = new http\Client\Factory(array("persistentHandleId" => "bar")); +$r = $f->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