summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorChristian Schneider2020-05-18 09:54:20 +0200
committerChristian Schneider2020-05-18 09:54:20 +0200
commit2393e0b28699675b5c6755a615e439af6ac31b37 (patch)
treeb85fe5d26d7ceea318615fc3af19a3139e9f6f3e /test
parent78ae466036ed812c298e01dccc6fdffa78e4cfba (diff)
downloaditools-2393e0b28699675b5c6755a615e439af6ac31b37.tar.gz
itools-2393e0b28699675b5c6755a615e439af6ac31b37.tar.bz2
itools-2393e0b28699675b5c6755a615e439af6ac31b37.zip
Add 'assoc' => true mode to it_url::get() and prepare to mark function static
Diffstat (limited to 'test')
-rwxr-xr-xtest/it_url.t26
1 files changed, 7 insertions, 19 deletions
diff --git a/test/it_url.t b/test/it_url.t
index edfbdb2..5bac758 100755
--- a/test/it_url.t
+++ b/test/it_url.t
@@ -119,41 +119,29 @@ is(
$url = new it_url('http://www.gna.ch/');
is((bool)$url->is_reachable(), true, "is_reachable($url->url)");
-$page = $url->get();
-ok(
- strpos($page, '</html>'), # UTF8SAFE
- '$url->get with url in constructor'
-);
$url = new it_url('http://www.search.ch/not_found');
is((bool)$url->is_reachable(), false, "is_reachable($url->url)");
$url = new it_url('http://bogus.url');
is((bool)$url->is_reachable(), false, "is_reachable($url->url)");
-$page = $url->get('http://www.gna.ch/');
-ok(
- strpos($page, '</html>'), # UTF8SAFE
- '$url->get(url) with url as string arg'
-);
-$url = new it_url('http://bogus.url');
-$page = $url->get(['url' => 'http://www.gna.ch/']);
+$response = it_url::get(['url' => 'http://www.gna.ch/', 'assoc' => true]);
ok(
- strpos($page, '</html>'), # UTF8SAFE
- '$url->get(\'url\' => url) with url as named arg'
+ strpos($response['data'], '</html>'), # UTF8SAFE
+ 'Get with url as named arg'
);
is(
- $url->result,
+ $response['status'],
'200',
- '$url->result = 200'
+ 'Reponse status = 200'
);
is(
- $url->headers['Server'],
+ $response['headers']['Server'],
'Apache',
- '$url->headers correctly set'
+ 'Response headers correctly set'
);
-unset($url, $page);
$page = it_url::get('http://www.gna.ch/');
ok(
strpos($page, '</html>'), # UTF8SAFE