Add mocked components to the enable list of components.

Mocked components should be enabled so they receive callbacks. This
allows more realistic integration tests using testAction(). Stop
disabling the constructor as it causes a number of errors with
components that use components.

Fixes #3842
This commit is contained in:
mark_story 2013-05-20 22:22:22 -04:00
parent 9cdc3927f2
commit 82d57fb8b2

View file

@ -363,8 +363,9 @@ abstract class ControllerTestCase extends CakeTestCase {
'class' => $componentClass
));
}
$componentObj = $this->getMock($componentClass, $methods, array(), '', false);
$componentObj = $this->getMock($componentClass, $methods, array($controllerObj->Components));
$controllerObj->Components->set($name, $componentObj);
$controllerObj->Components->enable($name);
}
$controllerObj->constructClasses();