summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAndrew Dolgov <fox@fakecake.org>2024-09-15 07:17:48 +0300
committerAndrew Dolgov <fox@fakecake.org>2024-09-15 07:17:48 +0300
commit0163884ef61bca4268621ef948b8cf21360b7b7f (patch)
tree4262ebdcf63d54bfe5bdc80be7395d409e98b4c2 /tests
parent9c44af354fd99d1bb24c09f5bd8b2b2b4d5a6104 (diff)
add another test for self url, split regex into two parts - one for plugins, one for everything else
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 f65f0060d..8d706c5af 100644
--- a/tests/ConfigTest.php
+++ b/tests/ConfigTest.php
@@ -116,6 +116,18 @@ final class SelfUrlPathTest extends TestCase {
);
}
+ public function test_self_url_j(): void {
+ $_SERVER = [];
+
+ $_SERVER["HTTP_HOST"] = "example.com";
+ $_SERVER["REQUEST_URI"] = "/tt-rss/plugins.local/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/