Merge pull request #10664 from ravage84/patch-2

Add inline type hint annotations
This commit is contained in:
Mark Story 2017-05-16 12:13:24 -04:00 committed by GitHub
commit ffd9e71bb9

View file

@ -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);