X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=tests%2FHttpRequestPool_005.phpt;h=a36299a1572af9b991c22f6da5bddd44d98195e0;hb=dd07cdeb2ed9752a82c9d052b42af2d639a785fd;hp=182f662e6849f6958b5e9c27516ea9d75b77a664;hpb=9cffeb53e0c4b03192092d2f58965bb35f599cab;p=m6w6%2Fext-http diff --git a/tests/HttpRequestPool_005.phpt b/tests/HttpRequestPool_005.phpt index 182f662..a36299a 100644 --- a/tests/HttpRequestPool_005.phpt +++ b/tests/HttpRequestPool_005.phpt @@ -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(1) -int(2) -int(1) -int(2) +HttpRequestPoolException: Exception caused by 2 inner exception(s) + HttpInvalidParamException: Empty or too short HTTP message: '' + HttpRequestException: couldn't resolve host name; Couldn't resolve host '_____' (http://_____/) +int(3) +HttpRequestPoolException: Exception caused by 4 inner exception(s) + HttpInvalidParamException: Empty or too short HTTP message: '' + HttpRequestException: couldn't resolve host name; Couldn't resolve host '_____' (http://_____/) + HttpInvalidParamException: Empty or too short HTTP message: '' + HttpRequestException: couldn't resolve host name; Couldn't resolve host '_____' (http://_____/) +int(5) Done