Merge pull request #350 from shama/patch-controller-test-case

Always set ControllerTestCase::testAction result variables
This commit is contained in:
Mark Story 2011-12-02 17:22:13 -08:00
commit f58d28abd4

View file

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