fix Config::get_self_url() invoked from plugin context, better deal with multiple trailing slashes in URL, update phpunit image path
This commit is contained in:
@@ -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/
|
||||
|
||||
Reference in New Issue
Block a user