diff options
author | Christian Schneider | 2023-08-22 16:12:24 +0200 |
---|---|---|
committer | Christian Schneider | 2023-08-22 16:12:24 +0200 |
commit | e70b53d3ef0991f3a09bc7fcaf070f27f2e4b83a (patch) | |
tree | 08378e881aa0de9455d5b5c9c5a737bbd812b258 /test/it_url.t | |
parent | 599fe205600c4d0634476a042c4b0c24d683ccb5 (diff) | |
download | itools-e70b53d3ef0991f3a09bc7fcaf070f27f2e4b83a.tar.gz itools-e70b53d3ef0991f3a09bc7fcaf070f27f2e4b83a.tar.bz2 itools-e70b53d3ef0991f3a09bc7fcaf070f27f2e4b83a.zip |
Add prefix to it_url::absolute() for OneDomain support, add tests for relative paths
Diffstat (limited to 'test/it_url.t')
-rwxr-xr-x | test/it_url.t | 15 |
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/'); |