X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=tests%2FHttpRequestPool_001.phpt;h=b65bf75b26ddc98e1c96acef85b98c85923110b6;hb=76ef3c1710bd22c560f9459f00452050d72f44db;hp=9f20fe4ee849fa631f391205f7f1effc7133cc3c;hpb=4c47eabee60a0266f3f27bf91528830b32da842e;p=m6w6%2Fext-http diff --git a/tests/HttpRequestPool_001.phpt b/tests/HttpRequestPool_001.phpt index 9f20fe4..b65bf75 100644 --- a/tests/HttpRequestPool_001.phpt +++ b/tests/HttpRequestPool_001.phpt @@ -3,7 +3,7 @@ HttpRequestPool --SKIPIF-- addPostFields(array('a'=>1,'b'=>2)) ; + $pool = new HttpRequestPool( new HttpRequest('http://www.php.net/', HTTP_METH_HEAD), new HttpRequest('http://at.php.net/', HTTP_METH_HEAD), new HttpRequest('http://de.php.net/', HTTP_METH_HEAD), new HttpRequest('http://ch.php.net/', HTTP_METH_HEAD), - $post = new HttpRequest('http://dev.iworks.at/.print_request.php', HTTP_METH_POST) + $post ); -$post->addPostFields(array('a'=>1,'b'=>2)) ; + $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')); @@ -35,11 +40,14 @@ foreach ($pool as $req) { echo ".\n"; } } + foreach ($pool as $req) { $pool->detach($req); } + echo "Done\n"; ?> + --EXPECTF-- %sTEST http://www.php.net/=200:200