X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=tests%2FHttpRequestPool_001.phpt;h=f94e92f2d0b2803d19a15724fd82b7d9c2024f16;hp=615bf6713c216382206804536c61fd59121761c8;hb=99b27b9e44043e5ff1bd53f2a1e3b007cfd16a42;hpb=62fd5b5f1e43cf04e0467a48578826726cfe5821 diff --git a/tests/HttpRequestPool_001.phpt b/tests/HttpRequestPool_001.phpt index 615bf67..f94e92f 100644 --- a/tests/HttpRequestPool_001.phpt +++ b/tests/HttpRequestPool_001.phpt @@ -3,31 +3,49 @@ HttpRequestPool --SKIPIF-- --FILE-- addPostFields(array('a'=>1,'b'=>2)) ; + $pool = new HttpRequestPool( - new HttpRequest('http://www.php.net/', HTTP_HEAD), - new HttpRequest('http://pear.php.net/', HTTP_HEAD), - new HttpRequest('http://pecl.php.net/', HTTP_HEAD) + new HttpRequest('http://www.php.net/', HTTP_METH_HEAD), + $post ); + $pool->send(); + foreach ($pool as $req) { echo $req->getUrl(), '=', $req->getResponseCode(), ':', $req->getResponseMessage()->getResponseCode(), "\n"; } + +foreach ($pool as $req) { + try { + $pool->attach(new HttpRequest('http://foo.bar')); + } catch (HttpRequestPoolException $x) { + echo ".\n"; + } +} + +foreach ($pool as $req) { + $pool->detach($req); +} + echo "Done\n"; ?> + --EXPECTF-- -%sTEST +%aTEST http://www.php.net/=200:200 -http://pear.php.net/=200:200 -http://pecl.php.net/=200:200 +http://dev.iworks.at/ext-http/.print_request.php=200:200 +. +. Done