mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Added a test case
This commit is contained in:
parent
00956110f5
commit
1202658396
1 changed files with 19 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue