Skip to content
Permalink
Browse files

Fixed indefinite loop in getMock().

  • Loading branch information...
bancer committed Jul 15, 2017
1 parent eefd3ac commit 93696b65e444e9f374adb02394dcf0262a97b6d3
Showing with 9 additions and 0 deletions.
  1. +9 −0 lib/Cake/TestSuite/CakeTestCase.php
@@ -737,6 +737,9 @@ protected function skipUnless($condition, $message = '') {
* 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 @@ public function getMock($originalClassName, $methods = array(),
$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);

0 comments on commit 93696b6

Please sign in to comment.
You can’t perform that action at this time.