X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=tests%2FHttpRequestPool_001.phpt;h=c0d9c940d79a6342ac4f707a868497a9d67a5652;hp=0b276b8b7c23e66d9dcb4aff75f6499ece8bba32;hb=ad5f896b03adaa073134a00108a9cdf00720673a;hpb=19cad54672b6babfac2b7c9c64c415c9a24b888a diff --git a/tests/HttpRequestPool_001.phpt b/tests/HttpRequestPool_001.phpt index 0b276b8..c0d9c94 100644 --- a/tests/HttpRequestPool_001.phpt +++ b/tests/HttpRequestPool_001.phpt @@ -3,28 +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-- -%shttp://www.php.net/=200:200 -http://pear.php.net/=200:200 -http://pecl.php.net/=200:200 +%aTEST +http://www.php.net/=200:200 +http://dev.iworks.at/ext-http/.print_request.php=200:200 +. +. Done