diff options
Diffstat (limited to 'tests/it_url.t')
-rwxr-xr-x | tests/it_url.t | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/it_url.t b/tests/it_url.t index d017610..0178e33 100755 --- a/tests/it_url.t +++ b/tests/it_url.t @@ -85,4 +85,45 @@ is( 'it_url::absolute for https' ); +$url = new it_url('http://www.gna.ch/'); +$page = $url->get(); +is( + it::match('(</html>)', $page), + '</html>', + '$url->get with url in constructor' +); + +$url = new it_url('http://bogus.url'); +$page = $url->get('http://www.gna.ch/'); +is( + it::match('(</html>)', $page), + '</html>', + '$url->get(url) with url as string arg' +); + +$url = new it_url('http://bogus.url'); +$page = $url->get('url' => 'http://www.gna.ch/'); +is( + it::match('(</html>)', $page), + '</html>', + '$url->get(\'url\' => url) with url as named arg' +); +is( + $url->result, + 200, + '$url->result = 200' +); +is( + $url->headers['Connection'], + 'close', + '$url->headers correctly set' +); + +unset($url, $page); +$page = it_url::get('http://www.gna.ch/'); +is( + it::match('(</html>)', $page), + '</html>', + 'it_url::get() static call' +); ?> |