diff options
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 |