- fix tests
[m6w6/ext-http] / tests / HttpRequestPool_005.phpt
1 --TEST--
2 HttpRequestPool exception
3 --SKIPIF--
4 <?php
5 include 'skip.inc';
6 checkmin(5);
7 checkcls('HttpRequestPool');
8 ?>
9 --FILE--
10 <?php
11 echo "-TEST\n";
12
13 $p = new HttpRequestPool(new HttpRequest('http://_____'));
14 try {
15 $p->send();
16 } catch (HttpRequestPoolException $x) {
17 for ($i=0; $x; ++$i, $x = @$x->innerException) {
18 printf("%s%s: %s\n", str_repeat("\t", $i), get_class($x), $x->getMessage());
19 }
20 var_dump($i);
21 }
22 $p = new HttpRequestPool(new HttpRequest('http://_____'), new HttpRequest('http://_____'));
23 try {
24 $p->send();
25 } catch (HttpRequestPoolException $x) {
26 for ($i=0; $x; ++$i, $x = @$x->innerException) {
27 printf("%s%s: %s\n", str_repeat("\t", $i), get_class($x), $x->getMessage());
28 }
29 var_dump($i);
30 }
31 echo "Done\n";
32 ?>
33 --EXPECTF--
34 %sTEST
35 HttpRequestPoolException: Exception caused by 2 inner exception(s)
36 HttpInvalidParamException: Empty or too short HTTP message: ''
37 HttpRequestException: couldn't resolve host name; %s (http://_____/)
38 int(3)
39 HttpRequestPoolException: Exception caused by 4 inner exception(s)
40 HttpInvalidParamException: Empty or too short HTTP message: ''
41 HttpRequestException: couldn't resolve host name; %s (http://_____/)
42 HttpInvalidParamException: Empty or too short HTTP message: ''
43 HttpRequestException: couldn't resolve host name; %s (http://_____/)
44 int(5)
45 Done
46