Adding an isset so a non-existant view isn't accessed.

Fixes #1954
This commit is contained in:
Mark Story mark@mark-story.com 2011-09-01 17:55:42 +01:00
parent 4d1f41dddc
commit 36eca679fe

View file

@ -229,8 +229,10 @@ abstract class ControllerTestCase extends CakeTestCase {
$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->headers = $Dispatch->response->header();