summaryrefslogtreecommitdiff
path: root/test/it_url.t
diff options
context:
space:
mode:
Diffstat (limited to 'test/it_url.t')
-rwxr-xr-xtest/it_url.t26
1 files changed, 13 insertions, 13 deletions
diff --git a/test/it_url.t b/test/it_url.t
index b265afa..edfbdb2 100755
--- a/test/it_url.t
+++ b/test/it_url.t
@@ -137,7 +137,7 @@ ok(
);
$url = new it_url('http://bogus.url');
-$page = $url->get(array('url' => 'http://www.gna.ch/'));
+$page = $url->get(['url' => 'http://www.gna.ch/']);
ok(
strpos($page, '</html>'), # UTF8SAFE
'$url->get(\'url\' => url) with url as named arg'
@@ -236,7 +236,7 @@ handle_server(
$output = handle_server(
ok(
- !it_url::get(array('url' => U('http://localhost:8000/redirect_loop', array('num' => 40)), 'it_error' => false)),
+ !it_url::get(['url' => U('http://localhost:8000/redirect_loop', ['num' => 40]), 'it_error' => false]),
'it_url::get() handles redirect loop'
)
);
@@ -249,7 +249,7 @@ if (!ok(
$output = handle_server(
ok(
- !it_url::get(array('url' => 'http://localhost:8000/does_not_exist', 'retries' => 4)),
+ !it_url::get(['url' => 'http://localhost:8000/does_not_exist', 'retries' => 4]),
'it_url::get() on 404'
)
);
@@ -261,7 +261,7 @@ if (!ok(
$output = handle_server(
ok(
- !it_url::get(array('url' => 'http://localhost:8000/repeat?num=0', 'retries' => 4)),
+ !it_url::get(['url' => 'http://localhost:8000/repeat?num=0', 'retries' => 4]),
'it_url::get() on empty page'
)
);
@@ -286,7 +286,7 @@ if (!ok(
handle_server(
is(
- it_url::get(U('http://localhost:8000/get_server_value', array('key' => 'HTTP_HOST'))),
+ it_url::get(U('http://localhost:8000/get_server_value', ['key' => 'HTTP_HOST'])),
'localhost:8000',
'it_url::get() sets correct Host header'
)
@@ -294,7 +294,7 @@ handle_server(
handle_server(
is(
- it_url::get(U('http://localhost:8000/get_server_value', array('key' => 'HTTP_ACCEPT_LANGUAGE'))),
+ it_url::get(U('http://localhost:8000/get_server_value', ['key' => 'HTTP_ACCEPT_LANGUAGE'])),
T_lang(),
'it_url::get() sets correct Accept-Language header'
)
@@ -302,14 +302,14 @@ handle_server(
handle_server(
ok(
- it::match('Mozilla', it_url::get(U('http://localhost:8000/get_server_value', array('key' => 'HTTP_USER_AGENT')))),
+ 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'
)
);
handle_server(
is(
- it_url::get(U('http://user:password@localhost:8000/get_server_value', array('key' => 'PHP_AUTH_USER'))),
+ it_url::get(U('http://user:password@localhost:8000/get_server_value', ['key' => 'PHP_AUTH_USER'])),
'user',
'it_url::get() basic authentication user'
)
@@ -317,17 +317,17 @@ handle_server(
handle_server(
is(
- it_url::get(U('http://user:password@localhost:8000/get_server_value', array('key' => 'PHP_AUTH_PW'))),
+ it_url::get(U('http://user:password@localhost:8000/get_server_value', ['key' => 'PHP_AUTH_PW'])),
'password',
'it_url::get() basic authentication password'
)
);
-$pages = it_url::get_multi(array('urls' => array('a' => 'http://www.gna.ch/', 'b' => 'http://search.ch/')));
+$pages = it_url::get_multi(['urls' => ['a' => 'http://www.gna.ch/', 'b' => 'http://search.ch/']]);
ok(strpos($pages['a'], '</html>'), 'it_url::get_multi got first url'); # UTF8SAFE
ok(strpos($pages['b'], '</html>'), 'it_url::get_multi got second url'); # UTF8SAFE
is(count($pages), 2, 'it_url::get_multi no additional array elements');
-is(it_url::parse("/foo"), array("/foo"), "it_url::parse path only");
-is(it_url::parse("/foo?"), array("/foo"), "it_url::parse empty parameter");
-is(it_url::parse("/foo?bar=baz&qux=quux"), array("/foo", 'bar' => "baz", 'qux' => "quux"), "it_url::parse parameters");
+is(it_url::parse("/foo"), ["/foo"], "it_url::parse path only");
+is(it_url::parse("/foo?"), ["/foo"], "it_url::parse empty parameter");
+is(it_url::parse("/foo?bar=baz&qux=quux"), ["/foo", 'bar' => "baz", 'qux' => "quux"], "it_url::parse parameters");