Permalink
Browse files

Added a test case

  • Loading branch information...
1 parent 0095611 commit 12026583960409d6ff8447e60f293dcab07ca56c Mike Gibson committed Mar 10, 2014
Showing with 19 additions and 0 deletions.
  1. +19 −0 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);
}
+
}

0 comments on commit 1202658

Please sign in to comment.