mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Fix issue with Controller::setAction()
Calling setAction did not modify which view file was rendered. This was a regression with 1.3 Fixes #2212
This commit is contained in:
parent
e95d67571b
commit
a929951038
2 changed files with 3 additions and 1 deletions
|
@ -805,6 +805,7 @@ class Controller extends Object {
|
|||
*/
|
||||
public function setAction($action) {
|
||||
$this->request->action = $action;
|
||||
$this->view = $action;
|
||||
$args = func_get_args();
|
||||
unset($args[0]);
|
||||
return call_user_func_array(array(&$this, $action), $args);
|
||||
|
|
|
@ -967,7 +967,8 @@ class ControllerTest extends CakeTestCase {
|
|||
$TestController = new TestController($request);
|
||||
$TestController->setAction('index', 1, 2);
|
||||
$expected = array('testId' => 1, 'test2Id' => 2);
|
||||
$this->assertidentical($TestController->data, $expected);
|
||||
$this->assertSame($expected, $TestController->request->data);
|
||||
$this->assertSame('index', $TestController->view);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue