mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 18:46:17 +00:00
Merge pull request #10664 from ravage84/patch-2
Add inline type hint annotations
This commit is contained in:
commit
ffd9e71bb9
1 changed files with 5 additions and 0 deletions
|
@ -256,6 +256,7 @@ abstract class ControllerTestCase extends CakeTestCase {
|
|||
}
|
||||
|
||||
$_SERVER['REQUEST_URI'] = $url;
|
||||
/** @var CakeRequest|PHPUnit_Framework_MockObject_MockObject $request */
|
||||
$request = $this->getMock('CakeRequest', array('_readInput'));
|
||||
|
||||
if (is_string($options['data'])) {
|
||||
|
@ -357,9 +358,12 @@ abstract class ControllerTestCase extends CakeTestCase {
|
|||
), (array)$mocks);
|
||||
|
||||
list($plugin, $name) = pluginSplit($controller);
|
||||
/** @var Controller|PHPUnit_Framework_MockObject_MockObject $controllerObj */
|
||||
$controllerObj = $this->getMock($name . 'Controller', $mocks['methods'], array(), '', false);
|
||||
$controllerObj->name = $name;
|
||||
/** @var CakeRequest|PHPUnit_Framework_MockObject_MockObject $request */
|
||||
$request = $this->getMock('CakeRequest');
|
||||
/** @var CakeResponse|PHPUnit_Framework_MockObject_MockObject $response */
|
||||
$response = $this->getMock($this->_responseClass, array('_sendHeader'));
|
||||
$controllerObj->__construct($request, $response);
|
||||
$controllerObj->Components->setController($controllerObj);
|
||||
|
@ -393,6 +397,7 @@ abstract class ControllerTestCase extends CakeTestCase {
|
|||
));
|
||||
}
|
||||
$config = isset($controllerObj->components[$component]) ? $controllerObj->components[$component] : array();
|
||||
/** @var Component|PHPUnit_Framework_MockObject_MockObject $componentObj */
|
||||
$componentObj = $this->getMock($componentClass, $methods, array($controllerObj->Components, $config));
|
||||
$controllerObj->Components->set($name, $componentObj);
|
||||
$controllerObj->Components->enable($name);
|
||||
|
|
Loading…
Add table
Reference in a new issue