summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNathan Gass2012-10-16 09:09:30 +0000
committerNathan Gass2012-10-16 09:09:30 +0000
commitd2ef55e48f160f44a64188dddeade2d2b6d32ee3 (patch)
tree685c9e44a408f45329beece50ecafd6168cd4401 /tests
parent35dbf89715a56fe976b0bb5714b00e7b94748895 (diff)
downloaditools-d2ef55e48f160f44a64188dddeade2d2b6d32ee3.tar.gz
itools-d2ef55e48f160f44a64188dddeade2d2b6d32ee3.tar.bz2
itools-d2ef55e48f160f44a64188dddeade2d2b6d32ee3.zip
add test for large response
Diffstat (limited to 'tests')
-rw-r--r--tests/it_url.testserver.php5
-rwxr-xr-xtests/it_url_slow.t8
2 files changed, 13 insertions, 0 deletions
diff --git a/tests/it_url.testserver.php b/tests/it_url.testserver.php
index fe90fcb..8763d6f 100644
--- a/tests/it_url.testserver.php
+++ b/tests/it_url.testserver.php
@@ -55,6 +55,11 @@ switch ($_SERVER['PHP_SELF'])
echo $_SERVER[$_REQUEST['key']];
break;
+ case "/repeat":
+ for ($i = 0; $i < $_REQUEST['num']; $i++)
+ echo $_REQUEST['string'];
+ break;
+
default:
fwrite($stderr, "Unknown path '$_SERVER[PHP_SELF]' not handled!\n");
}
diff --git a/tests/it_url_slow.t b/tests/it_url_slow.t
index 9474ef8..215528d 100755
--- a/tests/it_url_slow.t
+++ b/tests/it_url_slow.t
@@ -63,5 +63,13 @@ $output = server_output();
if (!$res || !$res2)
diag($output);
+$res = ok(
+ it_url::get(U('http://localhost:8000/repeat', 'string' => "abc", 'num' => 1024 * 1024)) == str_repeat("abc", 1024 * 1024),
+ 'it_url::get() handles large response',
+);
+$output = server_output();
+if (!$res)
+ diag($output);
+
proc_terminate($server);