Added a test case

This commit is contained in:
Mike Gibson 2014-03-10 12:03:04 +00:00
parent 00956110f5
commit 1202658396

View file

@ -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);
}
}