Browse Source

Add a failing test.

Verifies the existence of the issue mentioned here: https://github.com/cakephp/cakephp/issues/11467#issuecomment-423275388
Brian Porter 7 years ago
parent
commit
508f3be635
1 changed files with 18 additions and 0 deletions
  1. 18 0
      tests/TestCase/Routing/Route/RouteTest.php

+ 18 - 0
tests/TestCase/Routing/Route/RouteTest.php

@@ -1070,6 +1070,24 @@ class RouteTest extends TestCase
     }
 
     /**
+     * Test that match() matches explicit GET routes
+     *
+     * @return void
+     */
+    public function testMatchWithExplicitGet()
+    {
+        $route = new Route(
+            '/anything',
+            ['controller' => 'Articles', 'action' => 'foo', '_method' => 'GET']
+        );
+        $result = $route->match([
+            'controller' => 'Articles',
+            'action' => 'foo'
+        ]);
+        $this->assertEquals("/anything", $result);
+    }
+
+    /**
      * Test separartor.
      *
      * @return void