summaryrefslogtreecommitdiff
path: root/test/it_url_slow.t
diff options
context:
space:
mode:
authorUrban Müller2020-04-21 01:03:53 +0200
committerUrban Müller2020-04-21 01:03:53 +0200
commitd987adefc85095f057c3d6d3eb2fa4c0d487d32b (patch)
tree4a6f7be8e35ff0c412666c41a46f22383d8ed5c2 /test/it_url_slow.t
parent1bd13e02d21ba01f38cd6df04de84b25a75a5264 (diff)
downloaditools-d987adefc85095f057c3d6d3eb2fa4c0d487d32b.tar.gz
itools-d987adefc85095f057c3d6d3eb2fa4c0d487d32b.tar.bz2
itools-d987adefc85095f057c3d6d3eb2fa4c0d487d32b.zip
use new array syntax
Diffstat (limited to 'test/it_url_slow.t')
-rwxr-xr-xtest/it_url_slow.t8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/it_url_slow.t b/test/it_url_slow.t
index 04377c5..3462ce2 100755
--- a/test/it_url_slow.t
+++ b/test/it_url_slow.t
@@ -17,7 +17,7 @@ handle_server(
$start = microtime(true);
$res = ok(
- !it_url::get(array('url' => 'http://localhost:8000/long_sleep', 'timeout' => 5, 'retries' => 0, 'it_error' => false)),
+ !it_url::get(['url' => 'http://localhost:8000/long_sleep', 'timeout' => 5, 'retries' => 0, 'it_error' => false]),
'it_url::get() fails after timeout seconds with no output'
);
$res2 = is(
@@ -39,7 +39,7 @@ handle_server(
$start = microtime(true);
$res = ok(
- !it_url::get(array('url' => 'http://localhost:8000/slow_response', 'totaltimeout' => 5, 'retries' => 0, 'it_error' => false)),
+ !it_url::get(['url' => 'http://localhost:8000/slow_response', 'totaltimeout' => 5, 'retries' => 0, 'it_error' => false]),
'it_url::get() fails for response slower than totaltimeout'
);
$res2 = is(
@@ -53,12 +53,12 @@ if (!$res || !$res2)
handle_server(
ok(
- it_url::get(U('http://localhost:8000/repeat', array('string' => "abc", 'num' => 1024 * 1024))) == str_repeat("abc", 1024 * 1024),
+ it_url::get(U('http://localhost:8000/repeat', ['string' => "abc", 'num' => 1024 * 1024])) == str_repeat("abc", 1024 * 1024),
'it_url::get() handles large response'
)
);
$start = microtime(true);
-it_url::get_multi(array('urls' => array('slow' => 'http://localhost:8000/long_sleep', 'fast' => array('url' => 'http://search.ch/', 'handler' => function () {return true;}))));
+it_url::get_multi(['urls' => ['slow' => 'http://localhost:8000/long_sleep', 'fast' => ['url' => 'http://search.ch/', 'handler' => function () {return true;}]]]);
ok(intval(microtime(true) - $start) < 4, 'get_multi with handler aborts after fast request');
$output = server_output();