From 77d04fe9d6b1b784e9f9197ab308e09f184613ab Mon Sep 17 00:00:00 2001 From: Christian Weber Date: Wed, 2 Jun 2010 15:24:07 +0000 Subject: it_url::get() no longer creates new objects if not called statically. Added it_url::get() test cases --- tests/it_url.t | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'tests') 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('()', $page), + '', + '$url->get with url in constructor' +); + +$url = new it_url('http://bogus.url'); +$page = $url->get('http://www.gna.ch/'); +is( + it::match('()', $page), + '', + '$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('()', $page), + '', + '$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('()', $page), + '', + 'it_url::get() static call' +); ?> -- cgit v1.2.3