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:
mark_story 2011-11-03 20:13:22 -04:00
parent e95d67571b
commit a929951038
2 changed files with 3 additions and 1 deletions

View file

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

View file

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