summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAndrew Dolgov <fox@fakecake.org>2024-11-04 13:59:02 +0300
committerAndrew Dolgov <fox@fakecake.org>2024-11-04 13:59:02 +0300
commit42ebdb027ec249fb8e693c41d7ee80ecdc68d6ec (patch)
tree85f0b8ebfbb8089b0fb7721471c50062d56e972b /tests
parentd8718b757419aab9459b2c40205ae52e5309ce42 (diff)
fix get_self_url() misbehaving in plugins/
Diffstat (limited to 'tests')
-rw-r--r--tests/ConfigTest.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/ConfigTest.php b/tests/ConfigTest.php
index 8d706c5af..ee15df8d3 100644
--- a/tests/ConfigTest.php
+++ b/tests/ConfigTest.php
@@ -128,6 +128,18 @@ final class SelfUrlPathTest extends TestCase {
);
}
+ public function test_self_url_k(): void {
+ $_SERVER = [];
+
+ $_SERVER["HTTP_HOST"] = "example.com";
+ $_SERVER["REQUEST_URI"] = "/tt-rss/plugins/example/api/longpath/test.php/reader/api/0/stream/items/ids?n=1000&output=json&s=user/-/state/com.google/starred";
+
+ $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/