function TestCase::createTestProxy
Creates a test proxy for the specified class.
@psalm-template RealInstanceType of object
@psalm-param class-string<RealInstanceType> $originalClassName
@psalm-return MockObject&RealInstanceType
Throws
File
-
vendor/
phpunit/ phpunit/ src/ Framework/ TestCase.php, line 1393
Class
- TestCase
- @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
Namespace
PHPUnit\FrameworkCode
protected function createTestProxy(string $originalClassName, array $constructorArguments = []) : MockObject {
$testProxy = $this->getMockBuilder($originalClassName)
->setConstructorArgs($constructorArguments)
->enableProxyingToOriginalMethods()
->getMock();
Event\Facade::emitter()->testCreatedTestProxy($originalClassName, $constructorArguments);
return $testProxy;
}