diff options
author | Christian Schneider | 2020-05-18 09:54:20 +0200 |
---|---|---|
committer | Christian Schneider | 2020-05-18 09:54:20 +0200 |
commit | 2393e0b28699675b5c6755a615e439af6ac31b37 (patch) | |
tree | b85fe5d26d7ceea318615fc3af19a3139e9f6f3e /test/it_url.t | |
parent | 78ae466036ed812c298e01dccc6fdffa78e4cfba (diff) | |
download | itools-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/it_url.t')
-rwxr-xr-x | test/it_url.t | 26 |
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 |