From 12026583960409d6ff8447e60f293dcab07ca56c Mon Sep 17 00:00:00 2001 From: Mike Gibson Date: Mon, 10 Mar 2014 12:03:04 +0000 Subject: [PATCH] Added a test case --- .../Test/Case/Routing/Route/CakeRouteTest.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/lib/Cake/Test/Case/Routing/Route/CakeRouteTest.php b/lib/Cake/Test/Case/Routing/Route/CakeRouteTest.php index 1f0e283ca..16bed4cd6 100644 --- a/lib/Cake/Test/Case/Routing/Route/CakeRouteTest.php +++ b/lib/Cake/Test/Case/Routing/Route/CakeRouteTest.php @@ -855,6 +855,24 @@ class CakeRouteTest extends CakeTestCase { $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 @@ class CakeRouteTest extends CakeTestCase { $expected = array('section' => 'weblog', 'plugin' => 'blogs', 'controller' => 'posts', 'action' => 'index', 'pass' => array(), 'named' => array()); $this->assertEquals($expected, $result); } + }