mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
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:
parent
9cdc3927f2
commit
82d57fb8b2
1 changed files with 2 additions and 1 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue