Skip to content

Commit

Permalink
Added a test case
Browse files Browse the repository at this point in the history
  • Loading branch information
mgdigital committed Mar 10, 2014
1 parent 0095611 commit 1202658
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions lib/Cake/Test/Case/Routing/Route/CakeRouteTest.php
Expand Up @@ -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
*
Expand Down Expand Up @@ -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.