X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=tests%2Frequestpool001.phpt;h=790823c7310fac3d4f1715079a44653976b1489c;hb=2769c041b77a0aaba7acbee4ae469571eaeb2b0a;hp=a65ada45894b0105b33d3d5dbea0f1317f0e29e8;hpb=29a54250b58e444974ae19840194e214cab80bd5;p=m6w6%2Fext-http diff --git a/tests/requestpool001.phpt b/tests/requestpool001.phpt index a65ada4..790823c 100644 --- a/tests/requestpool001.phpt +++ b/tests/requestpool001.phpt @@ -9,9 +9,8 @@ include 'skipif.inc'; use http\request\Factory as HttpRequestFactory; use http\request\Pool as HttpRequestPool; -use http\request\Method as HttpRequestMethod; -use http\RequestException as HttpRequestException; -use http\SocketException as HttpSocketException; +use http\Exception as HttpRequestException; +use http\Exception as HttpSocketException; echo "-TEST\n"; @@ -53,7 +52,7 @@ class Pool extends HttpRequestPool $this->attach( $this->factory->createRequest( $url, - HttpRequestMethod::GET, + "GET", array( 'redirect' => 5, 'compress' => GZIP, @@ -87,7 +86,12 @@ class Pool extends HttpRequestPool $u = $r->getUrl(); $c = $r->getResponseCode(); - $b = $r->getResponseBody(); + try { + $b = $r->getResponseBody(); + } catch (\Exception $e) { + echo $e->getMessage(), "\n"; + $b = ""; + } printf("%d %s %d\n", $c, $u, strlen($b)); @@ -100,7 +104,7 @@ class Pool extends HttpRequestPool $this->attach( $this->factory->createRequest( $url, - HttpRequestMethod::GET, + "GET", array( 'redirect' => 5, 'compress' => GZIP, @@ -117,7 +121,7 @@ class Pool extends HttpRequestPool } define('GZIP', true); -define('TOUT', 50); +define('TOUT', 300); define('RMAX', 10); chdir(__DIR__);