summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChristian Weber2010-06-02 15:24:07 +0000
committerChristian Weber2010-06-02 15:24:07 +0000
commit77d04fe9d6b1b784e9f9197ab308e09f184613ab (patch)
treee0dfbdabb486b54f8c5c656fe47bd151ed9b4d05 /tests
parentaa3529d9a5d81d83b7bf82a33e4e8988ac81a420 (diff)
downloaditools-77d04fe9d6b1b784e9f9197ab308e09f184613ab.tar.gz
itools-77d04fe9d6b1b784e9f9197ab308e09f184613ab.tar.bz2
itools-77d04fe9d6b1b784e9f9197ab308e09f184613ab.zip
it_url::get() no longer creates new objects if not called statically. Added it_url::get() test cases
Diffstat (limited to 'tests')
-rwxr-xr-xtests/it_url.t41
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'
+);
?>