summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rwxr-xr-xtest/it_dbi.t2
-rwxr-xr-xtest/it_html.t2
-rw-r--r--test/it_url.testserver.php4
-rwxr-xr-xtest/it_url_slow.t7
4 files changed, 13 insertions, 2 deletions
diff --git a/test/it_dbi.t b/test/it_dbi.t
index b453da2..083047f 100755
--- a/test/it_dbi.t
+++ b/test/it_dbi.t
@@ -38,7 +38,7 @@ $opts['subclass']::createclass(['table' => "it_dbi_test", 'forcecreate' => true]
$record = new it_dbi_test;
$GLOBALS['it_defaultconfig']['fatal_throws_exception'] = true;
-is($record->query("SYNTAX ERROR", ['safety' => 0]), false, "Suppress failures with safety 0");
+is(@$record->query("SYNTAX ERROR", ['safety' => 0]), false, "Suppress failures with safety 0");
try {
is(@$record->select("SYNTAX ERROR"), "Exception", "Syntax triggers exception for fatal_throws_exception mode");
} catch (Exception $e) {
diff --git a/test/it_html.t b/test/it_html.t
index 20ab65f..13e2bc5 100755
--- a/test/it_html.t
+++ b/test/it_html.t
@@ -139,7 +139,7 @@ is(
# XML generation
unset($GLOBALS['it_html']);
-new it_html(['htmltype' => "xml", 'name' => 'it_html', 'tags' => "xmltest", 'error_on_redefine' => false]);
+new it_html(['htmltype' => "xml", 'name' => 'it_html', 'moretags' => "xmltest", 'error_on_redefine' => false]);
is(
xmltest(),
diff --git a/test/it_url.testserver.php b/test/it_url.testserver.php
index ca5300c..e59a81a 100644
--- a/test/it_url.testserver.php
+++ b/test/it_url.testserver.php
@@ -66,8 +66,12 @@ switch ($_SERVER['PHP_SELF'])
break;
case "/repeat":
+ if ($_REQUEST['compressed'])
+ ob_start('ob_gzhandler');
for ($i = 0; $i < $_REQUEST['num']; $i++)
echo $_REQUEST['string'];
+ if ($_REQUEST['compressed'])
+ ob_end_flush();
break;
case "/empty":
diff --git a/test/it_url_slow.t b/test/it_url_slow.t
index 00bbc2f..a5fd348 100755
--- a/test/it_url_slow.t
+++ b/test/it_url_slow.t
@@ -69,6 +69,13 @@ if (!$res || !$res2)
handle_server(
ok(
+ !it_url::get(['url' => "http://$host/repeat?string=abcdefghijklmnop&num=10&compressed", 'maxlength' => 100, 'retries' => 0, 'it_error' => false]),
+ 'it_url::get() fails for response larger than maxlength even if compressed response is smaller'
+ )
+);
+
+handle_server(
+ ok(
it_url::get(U("http://$host/repeat", ['string' => "abc", 'num' => 1024 * 1024])) == str_repeat("abc", 1024 * 1024),
'it_url::get() handles large response'
)