summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rwxr-xr-xtest/it_url.t15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/it_url.t b/test/it_url.t
index d2bb653..c147acc 100755
--- a/test/it_url.t
+++ b/test/it_url.t
@@ -74,6 +74,8 @@ is(
);
# it_url::absolute() tests
+$php_self = $_SERVER['PHP_SELF'];
+$_SERVER['PHP_SELF'] = '/foo/bar/self.php';
list ($_SERVER['HTTP_HOST'], $_SERVER['SERVER_PORT'], $_SERVER['HTTPS']) = ["gna.ch", null, null];
is(
it_url::absolute("/"),
@@ -81,6 +83,18 @@ is(
'it_url::absolute basic'
);
+is(
+ it_url::absolute("qux"),
+ 'http://gna.ch/foo/bar/qux',
+ 'it_url::absolute relative path'
+);
+
+is(
+ it_url::absolute("qux", 'https', '/prefix'),
+ 'https://gna.ch/prefix/foo/bar/qux',
+ 'it_url::absolute relative path'
+);
+
list ($_SERVER['HTTP_HOST'], $_SERVER['SERVER_PORT'], $_SERVER['HTTPS']) = ["gna.ch:42", 42, null];
is(
it_url::absolute("/port"),
@@ -115,6 +129,7 @@ is(
'https://gna.ch/foo',
'it_url::absolute force https overwriting existing url'
);
+$_SERVER['PHP_SELF'] = $php_self;
$url = new it_url('http://www.gna.ch/');