diff options
author | ArthurHoaro <arthur@hoa.ro> | 2020-08-27 10:27:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-27 10:27:34 +0200 |
commit | af41d5ab5d2bd3ba64d052c997bc6afa6966a63c (patch) | |
tree | 8fad2829c55f94022e359fa8914e11f80a2afc2a /tests/http/HttpUtils | |
parent | b8e3630f2ecd142d397b1b062a346a667bb78595 (diff) | |
parent | 0c6fdbe12bbbb336348666b14b82096f24d5858b (diff) | |
download | Shaarli-af41d5ab5d2bd3ba64d052c997bc6afa6966a63c.tar.gz Shaarli-af41d5ab5d2bd3ba64d052c997bc6afa6966a63c.tar.zst Shaarli-af41d5ab5d2bd3ba64d052c997bc6afa6966a63c.zip |
Merge pull request #1511 from ArthurHoaro/wip-slim-routing
Diffstat (limited to 'tests/http/HttpUtils')
-rw-r--r-- | tests/http/HttpUtils/IndexUrlTest.php | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/http/HttpUtils/IndexUrlTest.php b/tests/http/HttpUtils/IndexUrlTest.php index bcbe59cb..73d33cd4 100644 --- a/tests/http/HttpUtils/IndexUrlTest.php +++ b/tests/http/HttpUtils/IndexUrlTest.php | |||
@@ -71,4 +71,36 @@ class IndexUrlTest extends \PHPUnit\Framework\TestCase | |||
71 | ) | 71 | ) |
72 | ); | 72 | ); |
73 | } | 73 | } |
74 | |||
75 | /** | ||
76 | * The route is stored in REQUEST_URI | ||
77 | */ | ||
78 | public function testPageUrlWithRoute() | ||
79 | { | ||
80 | $this->assertEquals( | ||
81 | 'http://host.tld/picture-wall', | ||
82 | page_url( | ||
83 | array( | ||
84 | 'HTTPS' => 'Off', | ||
85 | 'SERVER_NAME' => 'host.tld', | ||
86 | 'SERVER_PORT' => '80', | ||
87 | 'SCRIPT_NAME' => '/index.php', | ||
88 | 'REQUEST_URI' => '/picture-wall', | ||
89 | ) | ||
90 | ) | ||
91 | ); | ||
92 | |||
93 | $this->assertEquals( | ||
94 | 'http://host.tld/admin/picture-wall', | ||
95 | page_url( | ||
96 | array( | ||
97 | 'HTTPS' => 'Off', | ||
98 | 'SERVER_NAME' => 'host.tld', | ||
99 | 'SERVER_PORT' => '80', | ||
100 | 'SCRIPT_NAME' => '/admin/index.php', | ||
101 | 'REQUEST_URI' => '/admin/picture-wall', | ||
102 | ) | ||
103 | ) | ||
104 | ); | ||
105 | } | ||
74 | } | 106 | } |