- add test
authorMichael Wallner <mike@php.net>
Thu, 1 Dec 2005 16:59:25 +0000 (16:59 +0000)
committerMichael Wallner <mike@php.net>
Thu, 1 Dec 2005 16:59:25 +0000 (16:59 +0000)
tests/HttpRequestPool_005.phpt [new file with mode: 0644]

diff --git a/tests/HttpRequestPool_005.phpt b/tests/HttpRequestPool_005.phpt
new file mode 100644 (file)
index 0000000..182f662
--- /dev/null
@@ -0,0 +1,47 @@
+--TEST--
+HttpRequestPool exception
+--SKIPIF--
+<?php
+include 'skip.inc';
+checkmin(5);
+checkcls('HttpRequestPool');
+?>
+--FILE--
+<?php
+echo "-TEST\n";
+
+$p = new HttpRequestPool(new HttpRequest('http://_____'));
+try {
+       $p->send();
+} catch (HttpRequestPoolException $x) {
+       var_dump(count($x->exceptionStack));
+}
+$p = new HttpRequestPool(new HttpRequest('http://_____'), new HttpRequest('http://_____'));
+try {
+       $p->send();
+} catch (HttpRequestPoolException $x) {
+       var_dump(count($x->exceptionStack));
+}
+
+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)
+Done
+