summaryrefslogtreecommitdiff
path: root/tests/it_url.t
diff options
context:
space:
mode:
Diffstat (limited to 'tests/it_url.t')
-rwxr-xr-xtests/it_url.t26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/it_url.t b/tests/it_url.t
index 9b9020c..de1cd0b 100755
--- a/tests/it_url.t
+++ b/tests/it_url.t
@@ -206,6 +206,32 @@ $res2 = ok(
if (!$res || !$res2)
diag($output);
+$res = is(
+ it_url::get(U('http://localhost:8000/get_server_value', 'key' => 'HTTP_HOST')),
+ 'localhost:8000',
+ 'TODO it_url::get() sets correct Host header',
+);
+$output = server_output();
+if (!$res)
+ diag($output);
+
+$res = is(
+ it_url::get(U('http://localhost:8000/get_server_value', 'key' => 'HTTP_ACCEPT_LANGUAGE')),
+ T_lang(),
+ 'it_url::get() sets correct Accept-Language header',
+);
+$output = server_output();
+if (!$res)
+ diag($output);
+
+$res = ok(
+ it::match('Mozilla', it_url::get(U('http://localhost:8000/get_server_value', 'key' => 'HTTP_USER_AGENT'))),
+ 'it_url::get() sets User-Agent containing Mozilla',
+);
+$output = server_output();
+if (!$res)
+ diag($output);
+
$pages = it_url::get_multi('urls' => array('a' => 'http://www.gna.ch/', 'b' => 'http://search.ch/'));
ok(strpos($pages['a'], '</html>'), 'it_url::get_multi got first url'); # UTF8SAFE
ok(strpos($pages['b'], '</html>'), 'it_url::get_multi got second url'); # UTF8SAFE