X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2Fhttp%2FHttpUtils%2FIndexUrlTest.php;h=73d33cd450d783237829c133641783b5715243b3;hb=af41d5ab5d2bd3ba64d052c997bc6afa6966a63c;hp=bcbe59cbf6abe493a392f429fb96f1c54cb2d46c;hpb=51753e403fa69c0ce124ede27d300477e3e799ca;p=github%2Fshaarli%2FShaarli.git 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 ) ); } + + /** + * The route is stored in REQUEST_URI + */ + public function testPageUrlWithRoute() + { + $this->assertEquals( + 'http://host.tld/picture-wall', + page_url( + array( + 'HTTPS' => 'Off', + 'SERVER_NAME' => 'host.tld', + 'SERVER_PORT' => '80', + 'SCRIPT_NAME' => '/index.php', + 'REQUEST_URI' => '/picture-wall', + ) + ) + ); + + $this->assertEquals( + 'http://host.tld/admin/picture-wall', + page_url( + array( + 'HTTPS' => 'Off', + 'SERVER_NAME' => 'host.tld', + 'SERVER_PORT' => '80', + 'SCRIPT_NAME' => '/admin/index.php', + 'REQUEST_URI' => '/admin/picture-wall', + ) + ) + ); + } }