mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-04 10:32:40 +00:00
Defining default values for CakeRequest, those params are present anywhere except when there isn't a Route match.
This commit is contained in:
parent
bba66f6506
commit
b0b36e8fba
2 changed files with 8 additions and 2 deletions
|
@ -39,6 +39,8 @@ class CakeRequest implements ArrayAccess {
|
|||
'plugin' => null,
|
||||
'controller' => null,
|
||||
'action' => null,
|
||||
'named' => array(),
|
||||
'pass' => array(),
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
|
@ -2157,7 +2157,8 @@ class RouterTest extends CakeTestCase {
|
|||
|
||||
$expected = array(
|
||||
'plugin' => null, 'controller' => false, 'action' => false,
|
||||
'param1' => '1', 'param2' => '2'
|
||||
'named' => array(), 'pass' => array(),
|
||||
'param1' => '1', 'param2' => '2',
|
||||
);
|
||||
$this->assertEquals(Router::getParams(), $expected);
|
||||
$this->assertEquals(Router::getParam('controller'), false);
|
||||
|
@ -2168,7 +2169,10 @@ class RouterTest extends CakeTestCase {
|
|||
|
||||
$params = array('controller' => 'pages', 'action' => 'display');
|
||||
Router::setRequestInfo(array($params, $paths));
|
||||
$expected = array('plugin' => null, 'controller' => 'pages', 'action' => 'display');
|
||||
$expected = array(
|
||||
'plugin' => null, 'controller' => 'pages', 'action' => 'display',
|
||||
'named' => array(), 'pass' => array(),
|
||||
);
|
||||
$this->assertEquals(Router::getParams(), $expected);
|
||||
$this->assertEquals(Router::getParams(true), $expected);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue