Polyfill the method createPartialMock
This commit is contained in:
parent
215ba8a47c
commit
a68c16d844
@ -105,6 +105,26 @@ trait ForwardCompatTestTraitForV5
|
||||
return $mock->getMock();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $originalClassName
|
||||
*
|
||||
* @return MockObject
|
||||
*/
|
||||
protected function createPartialMock($originalClassName, array $methods)
|
||||
{
|
||||
$mock = $this->getMockBuilder($originalClassName)
|
||||
->disableOriginalConstructor()
|
||||
->disableOriginalClone()
|
||||
->disableArgumentCloning()
|
||||
->setMethods(empty($methods) ? null : $methods);
|
||||
|
||||
if (method_exists($mock, 'disallowMockingUnknownTypes')) {
|
||||
$mock = $mock->disallowMockingUnknownTypes();
|
||||
}
|
||||
|
||||
return $mock->getMock();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $message
|
||||
*
|
||||
|
Reference in New Issue
Block a user