diff options
author | Christian Schneider | 2019-10-17 16:46:36 +0200 |
---|---|---|
committer | Christian Schneider | 2019-10-17 16:48:16 +0200 |
commit | 55597357c715484494bc7ef58ee36a6d0e5b63f6 (patch) | |
tree | 3785884562f9cb33c56b37144e7e555dc76bc0c2 /test | |
parent | 9f948f44cdc55b9cac093eb14b0e453901953075 (diff) | |
download | itools-55597357c715484494bc7ef58ee36a6d0e5b63f6.tar.gz itools-55597357c715484494bc7ef58ee36a6d0e5b63f6.tar.bz2 itools-55597357c715484494bc7ef58ee36a6d0e5b63f6.zip |
Fix ->is_reachable to use get() instead of fopen to use HTTP/1.1 and add tests
Diffstat (limited to 'test')
-rwxr-xr-x | test/it_url.t | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/it_url.t b/test/it_url.t index 624b4bf..b265afa 100755 --- a/test/it_url.t +++ b/test/it_url.t @@ -118,13 +118,18 @@ 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 |