diff --git a/lib/Cake/Test/Case/Routing/Route/CakeRouteTest.php b/lib/Cake/Test/Case/Routing/Route/CakeRouteTest.php index 1f0e283ca19..16bed4cd6f5 100644 --- a/lib/Cake/Test/Case/Routing/Route/CakeRouteTest.php +++ b/lib/Cake/Test/Case/Routing/Route/CakeRouteTest.php @@ -855,6 +855,24 @@ public function testMatchNamedParametersArray() { $this->assertEquals($expected, $result); } +/** + * Test matching of parameters where one parameter name starts with another parameter name + * + * @return void + */ + public function testMatchSimilarParameters() { + $route = new CakeRoute('/:thisParam/:thisParamIsLonger'); + + $url = array( + 'thisParam' => 'foo', + 'thisParamIsLonger' => 'bar' + ); + + $result = $route->match($url); + $expected = '/foo/bar'; + $this->assertEquals($expected, $result); + } + /** * test restructuring args with pass key * @@ -941,4 +959,5 @@ public function testUTF8PatternOnSection() { $expected = array('section' => 'weblog', 'plugin' => 'blogs', 'controller' => 'posts', 'action' => 'index', 'pass' => array(), 'named' => array()); $this->assertEquals($expected, $result); } + }