Skip to content

Commit 81f9d89

Browse files
committed
Fix TestCase Fixture for PHP 5.*
1 parent 8852230 commit 81f9d89

File tree

1 file changed

+32
-5
lines changed

1 file changed

+32
-5
lines changed

tests/Fixtures/TestCase.php

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,46 @@ protected function createMock($originalClassName)
4545
}
4646

4747
/**
48-
* Returns a test double for the specified class.
48+
* Returns a mock object for the specified class.
4949
*
5050
* Shim for PHPUnit 6
5151
*
52-
* @param string $originalClassName
52+
* @param string $originalClassName Name of the class to mock.
53+
* @param array|null $methods When provided, only methods whose names are in the array
54+
* are replaced with a configurable test double. The behavior
55+
* of the other methods is not changed.
56+
* Providing null means that no methods will be replaced.
57+
* @param array $arguments Parameters to pass to the original class' constructor.
58+
* @param string $mockClassName Class name for the generated test double class.
59+
* @param bool $callOriginalConstructor Can be used to disable the call to the original class' constructor.
60+
* @param bool $callOriginalClone Can be used to disable the call to the original class' clone constructor.
61+
* @param bool $callAutoload Can be used to disable __autoload() during the generation of the test double class.
62+
* @param bool $cloneArguments
63+
* @param bool $callOriginalMethods
64+
* @param object $proxyTarget
65+
*
5366
* @return PHPUnit_Framework_MockObject_MockObject
54-
* @throws Exception
67+
*
68+
* @throws PHPUnit_Framework_Exception
69+
*
70+
* @since Method available since Release 3.0.0
5571
*/
56-
public function getMock($originalClassName)
72+
public function getMock($originalClassName, $methods = array(), array $arguments = array(), $mockClassName = '', $callOriginalConstructor = true, $callOriginalClone = true, $callAutoload = true, $cloneArguments = false, $callOriginalMethods = false, $proxyTarget = null)
5773
{
5874
if (is_callable('parent::getMock'))
5975
{
60-
return parent::getMock($originalClassName);
76+
return parent::getMock(
77+
$originalClassName,
78+
$methods,
79+
$arguments,
80+
$mockClassName,
81+
$callOriginalConstructor,
82+
$callOriginalClone,
83+
$callAutoload,
84+
$cloneArguments,
85+
$callOriginalMethods,
86+
$proxyTarget
87+
);
6188
}
6289

6390
return $this->getMockBuilder($originalClassName)

0 commit comments

Comments
 (0)