summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorUrban Müller2015-08-10 16:01:12 +0200
committerUrban Müller2015-08-10 16:01:12 +0200
commit21205b1d20a4c0325e3b4484f1501078f6dd6846 (patch)
tree1be02b63c03c3c41deb7896742200218b284a6e0 /tests
parent160f67d68300cb5bc49f305c16c0d4da5d551821 (diff)
downloaditools-21205b1d20a4c0325e3b4484f1501078f6dd6846.tar.gz
itools-21205b1d20a4c0325e3b4484f1501078f6dd6846.tar.bz2
itools-21205b1d20a4c0325e3b4484f1501078f6dd6846.zip
php 5.3 compatibility
Diffstat (limited to 'tests')
-rwxr-xr-xtests/it_url.t28
-rwxr-xr-xtests/it_url_slow.t12
2 files changed, 20 insertions, 20 deletions
diff --git a/tests/it_url.t b/tests/it_url.t
index c843bba..0b81881 100755
--- a/tests/it_url.t
+++ b/tests/it_url.t
@@ -131,7 +131,7 @@ handle_server(
is(
it_url::get('http://localhost:8000/'),
"Testserver root output",
- 'it_url::get() static call with port',
+ 'it_url::get() static call with port'
)
);
@@ -139,7 +139,7 @@ handle_server(
is(
it_url::get(array('url' => 'http://localhost:8000/', 'maxlength' => 100)),
"Testserver root output",
- 'it_url::get() static call with port and maxlength',
+ 'it_url::get() static call with port and maxlength'
)
);
@@ -147,7 +147,7 @@ handle_server(
is(
it_url::get(array('url' => 'http://localhost:8000/', 'maxlength' => 5)),
false,
- 'it_url::get() static call with port and too small maxlength',
+ 'it_url::get() static call with port and too small maxlength'
)
);
@@ -155,7 +155,7 @@ handle_server(
is(
it_url::get('http://localhost:8000/temp_redirect'),
"Testserver output after temporary redirect",
- 'it_url::get() follows temproary redirect',
+ 'it_url::get() follows temproary redirect'
)
);
@@ -163,7 +163,7 @@ handle_server(
is(
it_url::get('http://localhost:8000/perm_redirect'),
"Testserver output after permanent redirect",
- 'it_url::get() follows permanent redirect',
+ 'it_url::get() follows permanent redirect'
)
);
@@ -171,7 +171,7 @@ handle_server(
is(
it_url::get('http://localhost:8000/relative_redirect'),
"Testserver output after relative redirect",
- 'TODO: it_url::get() follows relative redirect correctly',
+ 'TODO: it_url::get() follows relative redirect correctly'
)
);
@@ -179,32 +179,32 @@ handle_server(
is(
it_url::get('http://localhost:8000/nohost_redirect'),
"Testserver output after nohost redirect",
- 'TODO: it_url::get() follows redirect without host correctly',
+ 'TODO: it_url::get() follows redirect without host correctly'
)
);
$output = handle_server(
ok(
!it_url::get(U('http://localhost:8000/redirect_loop', 'num' => 10)),
- 'it_url::get() handles redirect loop',
+ 'it_url::get() handles redirect loop'
)
);
$last_num = it::match('num=(\d+)', end($output));
if (!ok(
$last_num == 5,
- 'it_url::get() aborts redirect loop after 5 redirects',
+ 'it_url::get() aborts redirect loop after 5 redirects'
))
diag($output);
$output = handle_server(
ok(
!it_url::get('url' => 'http://localhost:8000/does_not_exist', 'retries' => 4),
- 'it_url::get() retries on empty response',
+ 'it_url::get() retries on empty response'
)
);
if (!ok(
count(preg_grep('/^Got Request:/', $output)) == 5,
- 'it_url::get() respects set retry count',
+ 'it_url::get() respects set retry count'
))
diag($output);
@@ -212,7 +212,7 @@ handle_server(
is(
it_url::get(U('http://localhost:8000/get_server_value', 'key' => 'HTTP_HOST')),
'localhost:8000',
- 'it_url::get() sets correct Host header',
+ 'it_url::get() sets correct Host header'
)
);
@@ -220,14 +220,14 @@ handle_server(
is(
it_url::get(U('http://localhost:8000/get_server_value', 'key' => 'HTTP_ACCEPT_LANGUAGE')),
T_lang(),
- 'it_url::get() sets correct Accept-Language header',
+ 'it_url::get() sets correct Accept-Language header'
)
);
handle_server(
ok(
it::match('Mozilla', it_url::get(U('http://localhost:8000/get_server_value', 'key' => 'HTTP_USER_AGENT'))),
- 'it_url::get() sets User-Agent containing Mozilla',
+ 'it_url::get() sets User-Agent containing Mozilla'
)
);
diff --git a/tests/it_url_slow.t b/tests/it_url_slow.t
index aa85a80..22aae10 100755
--- a/tests/it_url_slow.t
+++ b/tests/it_url_slow.t
@@ -11,18 +11,18 @@ handle_server(
is(
it_url::get('http://localhost:8000/short_sleep'),
"Testserver output after short sleep",
- 'it_url::get() waits for 4 seconds',
+ 'it_url::get() waits for 4 seconds'
)
);
$start = microtime(true);
$res = ok(
!it_url::get(array('url' => 'http://localhost:8000/long_sleep', 'timeout' => 5, 'retries' => 0)),
- 'it_url::get() fails after timeout seconds with no output',
+ 'it_url::get() fails after timeout seconds with no output'
);
$res2 = is(
intval(microtime(true) - $start), 5,
- '... and fails as soon as timeout is surpassed',
+ '... and fails as soon as timeout is surpassed'
);
sleep(1); # wait for testserver
$output = server_output();
@@ -33,14 +33,14 @@ handle_server(
is(
it_url::get('http://localhost:8000/slow_response'),
join('', it::map('"Testserver slow output $v\n"', range(0, 5))),
- 'it_url::get() waits for slow response with continuous output',
+ 'it_url::get() waits for slow response with continuous output'
)
);
$start = microtime(true);
$res = ok(
!it_url::get(array('url' => 'http://localhost:8000/slow_response', 'totaltimeout' => 5, 'retries' => 0)),
- 'it_url::get() fails for response slower than totaltimeout',
+ 'it_url::get() fails for response slower than totaltimeout'
);
$res2 = is(
intval(microtime(true) - $start), 5,
@@ -54,7 +54,7 @@ if (!$res || !$res2)
handle_server(
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',
+ 'it_url::get() handles large response'
)
);