projects
/
m6w6
/
ext-http
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
- remove the declaration of http_request_global_init() from the header too
[m6w6/ext-http]
/
tests
/
HttpRequestPool_001.phpt
diff --git
a/tests/HttpRequestPool_001.phpt
b/tests/HttpRequestPool_001.phpt
index fd3853ad0556dbaea5c04d19a5beba3f1dbd59f5..8c1b05be4ace27a2be8e39f1039fd1fd6d488a7e 100644
(file)
--- a/
tests/HttpRequestPool_001.phpt
+++ b/
tests/HttpRequestPool_001.phpt
@@
-3,46
+3,29
@@
HttpRequestPool
--SKIPIF--
<?php
include 'skip.inc';
--SKIPIF--
<?php
include 'skip.inc';
-(5 > (int) PHP_VERSION) and die('skip PHP5 is required for Http classes');
+checkver(5);
+checkurl('www.php.net');
+checkurl('pear.php.net');
+checkurl('pecl.php.net');
?>
--FILE--
<?php
?>
--FILE--
<?php
-$urls = array(
- 'http://www.php.net',
- 'http://pear.php.net',
- 'http://pecl.php.net'
+echo "-TEST\n";
+$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)
);
);
-$pool = new HttpRequestPool;
-foreach ($urls as $url) {
- $pool->attach($reqs[] = new HttpRequest($url, HTTP_HEAD));
-}
$pool->send();
$pool->send();
-foreach ($
reqs
as $req) {
- echo $req->get
ResponseInfo('effective_url'
), '=',
+foreach ($
pool
as $req) {
+ echo $req->get
Url(
), '=',
$req->getResponseCode(), ':',
$req->getResponseMessage()->getResponseCode(), "\n";
$req->getResponseCode(), ':',
$req->getResponseMessage()->getResponseCode(), "\n";
- $pool->detach($req);
- $pool->attach($req);
- $pool->detach($req);
- $pool->attach($req);
- $pool->detach($req);
- $pool->attach($req);
- $pool->detach($req);
- $pool->attach($req);
- $req->getResponseMessage()->getResponseCode();
- $req->getResponseMessage()->getResponseCode();
- $req->getResponseMessage()->getResponseCode();
- $req->getResponseMessage()->getResponseCode();
}
}
-$pool->send();
-$pool->reset();
-$pool->attach($req);
echo "Done\n";
?>
--EXPECTF--
echo "Done\n";
?>
--EXPECTF--
-Content-type: text/html
-X-Powered-By: PHP/%s
-
+%sTEST
http://www.php.net/=200:200
http://pear.php.net/=200:200
http://pecl.php.net/=200:200
http://www.php.net/=200:200
http://pear.php.net/=200:200
http://pecl.php.net/=200:200