mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Fixed indefinite loop in getMock().
This commit is contained in:
parent
eefd3ac847
commit
93696b65e4
1 changed files with 9 additions and 0 deletions
|
@ -737,6 +737,9 @@ abstract class CakeTestCase extends PHPUnit_Framework_TestCase {
|
|||
* to disable the call to the original class' clone constructor.
|
||||
* @param boolean $callAutoload The seventh (optional) parameter can be used to
|
||||
* disable __autoload() during the generation of the test double class.
|
||||
* @param boolean $cloneArguments Not supported.
|
||||
* @param boolean $callOriginalMethods Not supported.
|
||||
* @param string $proxyTarget Not supported.
|
||||
* @return object
|
||||
* @throws InvalidArgumentException
|
||||
* @deprecated Use `getMockBuilder()` or `createMock` in new unit tests.
|
||||
|
@ -747,6 +750,12 @@ abstract class CakeTestCase extends PHPUnit_Framework_TestCase {
|
|||
$callOriginalConstructor = true, $callOriginalClone = true,
|
||||
$callAutoload = true, $cloneArguments = false,
|
||||
$callOriginalMethods = false, $proxyTarget = null) {
|
||||
$phpUnitVersion = PHPUnit_Runner_Version::id();
|
||||
if ($phpUnitVersion < '5.7.0') {
|
||||
return parent::getMock($originalClassName, $methods, $arguments,
|
||||
$mockClassName, $callOriginalConstructor, $callOriginalClone,
|
||||
$callAutoload, $cloneArguments, $callOriginalMethods, $proxyTarget);
|
||||
}
|
||||
$MockBuilder = $this->getMockBuilder($originalClassName);
|
||||
if (!empty($methods)) {
|
||||
$MockBuilder = $MockBuilder->setMethods($methods);
|
||||
|
|
Loading…
Reference in a new issue