diff --git a/lib/Cake/TestSuite/ControllerTestCase.php b/lib/Cake/TestSuite/ControllerTestCase.php index 4b9fbbc98..9c62c3ecd 100644 --- a/lib/Cake/TestSuite/ControllerTestCase.php +++ b/lib/Cake/TestSuite/ControllerTestCase.php @@ -263,12 +263,10 @@ abstract class ControllerTestCase extends CakeTestCase { $Dispatch->response = $this->getMock('CakeResponse', array('send')); $this->result = $Dispatch->dispatch($request, $Dispatch->response, $params); $this->controller = $Dispatch->testController; - if ($options['return'] != 'result') { - if (isset($this->controller->View)) { - $this->vars = $this->controller->View->viewVars; - $this->view = $this->controller->View->_viewNoLayout; - } - $this->contents = $this->controller->response->body(); + $this->vars = $this->controller->viewVars; + $this->contents = $this->controller->response->body(); + if (isset($this->controller->View)) { + $this->view = $this->controller->View->_viewNoLayout; } $this->__dirtyController = true; $this->headers = $Dispatch->response->header();