diff options
| author | Andrew Dolgov <fox@fakecake.org> | 2024-09-14 10:53:40 +0300 |
|---|---|---|
| committer | Andrew Dolgov <fox@fakecake.org> | 2024-09-14 10:53:40 +0300 |
| commit | 78c903cb7f10ae2e3f1f7ed6af65d99a229d4e03 (patch) | |
| tree | 7269f05ab5361d5e71a4967c6f75348f1713ec18 /tests/ConfigTest.php | |
| parent | 3619ee97c546cbc8dcb300c594b2d59e40043397 (diff) | |
fix Config::get_self_url() invoked from plugin context, better deal with multiple trailing slashes in URL, update phpunit image path
Diffstat (limited to 'tests/ConfigTest.php')
| -rw-r--r-- | tests/ConfigTest.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/ConfigTest.php b/tests/ConfigTest.php index 30f3a212a..f65f0060d 100644 --- a/tests/ConfigTest.php +++ b/tests/ConfigTest.php @@ -104,6 +104,18 @@ final class SelfUrlPathTest extends TestCase { ); } + public function test_self_url_i(): void { + $_SERVER = []; + + $_SERVER["HTTP_HOST"] = "example.com"; + $_SERVER["REQUEST_URI"] = "/tt-rss////plugins.local/example///api/long path/test.php"; + + $this->assertEquals( + 'http://example.com/tt-rss', + Config::get_self_url(true) + ); + } + public function test_get_self_dir(): void { $this->assertEquals( dirname(__DIR__), # we're in (app)/tests/ |