Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added a test case

  • Loading branch information...
commit 12026583960409d6ff8447e60f293dcab07ca56c 1 parent 0095611
Mike Gibson authored
Showing with 19 additions and 0 deletions.
  1. +19 −0 lib/Cake/Test/Case/Routing/Route/CakeRouteTest.php
View
19 lib/Cake/Test/Case/Routing/Route/CakeRouteTest.php
@@ -856,6 +856,24 @@ public function testMatchNamedParametersArray() {
}
/**
+ * 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
*
* @return void
@@ -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);
}
+
}
Please sign in to comment.
Something went wrong with that request. Please try again.