Skip to content
Permalink
Browse files

Set components on the controller in ControllerTestCase.

Because we aren't re-calling constructClasses() anymore, we need to set
the mocked components onto the controller in addition to having set them
in the registry.
  • Loading branch information...
markstory committed Sep 14, 2014
1 parent a42d56a commit 059bdc7b09908278774d7e7776b1dbbe0bc5bdca
Showing with 1 addition and 2 deletions.
  1. +1 −2 src/TestSuite/ControllerTestCase.php
@@ -416,11 +416,10 @@ public function generate($controller, array $mocks = array(), $request = null) {
$config = isset($controller->components[$component]) ? $controller->components[$component] : array();
$component = $this->getMock($componentClass, $methods, array($registry, $config));
$registry->set($name, $component);
$controller->{$name} = $component;
}
$controller->constructClasses();
$this->_dirtyController = false;
$this->controller = $controller;
return $this->controller;
}

0 comments on commit 059bdc7

Please sign in to comment.
You can’t perform that action at this time.