]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - tests/http/HttpUtils/IndexUrlTest.php
Process Daily RSS feed through Slim controller
[github/shaarli/Shaarli.git] / tests / http / HttpUtils / IndexUrlTest.php
index bcbe59cbf6abe493a392f429fb96f1c54cb2d46c..73d33cd450d783237829c133641783b5715243b3 100644 (file)
@@ -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',
+                )
+            )
+        );
+    }
 }