- Fixed build on php-trunk
[m6w6/ext-http] / tests / HttpRequestPool_005.phpt
index 19782674df6f933656d636493f4f4a7362416bab..4770fe779f6206a6526cbcfa172b51204d05f4d3 100644 (file)
@@ -3,7 +3,7 @@ HttpRequestPool exception
 --SKIPIF--
 <?php
 include 'skip.inc';
-checkmin(5);
+checkmin("5.2.5");
 checkcls('HttpRequestPool');
 ?>
 --FILE--
@@ -14,34 +14,33 @@ $p = new HttpRequestPool(new HttpRequest('http://_____'));
 try {
        $p->send();
 } catch (HttpRequestPoolException $x) {
-       var_dump(count($x->exceptionStack));
+       for ($i=0; $x; ++$i, $x = @$x->innerException) {
+               printf("%s%s: %s\n", str_repeat("\t", $i), get_class($x), $x->getMessage());
+       }
+       var_dump($i);
 }
 $p = new HttpRequestPool(new HttpRequest('http://_____'), new HttpRequest('http://_____'));
 try {
        $p->send();
 } catch (HttpRequestPoolException $x) {
-       var_dump(count($x->exceptionStack));
+       for ($i=0; $x; ++$i, $x = @$x->innerException) {
+               printf("%s%s: %s\n", str_repeat("\t", $i), get_class($x),  $x->getMessage());
+       }
+       var_dump($i);
 }
-
-try {
-       $p = new HttpRequestPool(new HttpRequest);
-} catch (HttpRequestPoolException $x) {
-       var_dump(count($x->exceptionStack));
-}
-
-try {
-       $p = new HttpRequestPool(new HttpRequest, new HttpRequest);
-} catch (HttpRequestPoolException $x) {
-       var_dump(count($x->exceptionStack));
-}
-
 echo "Done\n";
 ?>
 --EXPECTF--
-%sTEST
-int(2)
-int(4)
-int(1)
-int(2)
+%aTEST
+HttpRequestPoolException: Exception caused by 2 inner exception(s)
+       HttpInvalidParamException: Empty or too short HTTP message: ''
+               HttpRequestException: %souldn't resolve host name; %s (http://_____/)
+int(3)
+HttpRequestPoolException: Exception caused by 4 inner exception(s)
+       HttpInvalidParamException: Empty or too short HTTP message: ''
+               HttpRequestException: %souldn't resolve host name; %s (http://_____/)
+                       HttpInvalidParamException: Empty or too short HTTP message: ''
+                               HttpRequestException: %souldn't resolve host name; %s (http://_____/)
+int(5)
 Done