function ProphecyTrait::prophesize
@template T of object @phpstan-param class-string<T>|null $classOrInterface @phpstan-return ($classOrInterface is null ? ObjectProphecy<object> : ObjectProphecy<T>)
@not-deprecated
Throws
File
-
vendor/
phpspec/ prophecy-phpunit/ src/ ProphecyTrait.php, line 45
Class
- ProphecyTrait
- @mixin TestCase
Namespace
Prophecy\PhpUnitCode
protected function prophesize(?string $classOrInterface = null) : ObjectProphecy {
static $isPhpUnit9;
$isPhpUnit9 = $isPhpUnit9 ?? method_exists($this, 'recordDoubledType');
if (!$isPhpUnit9) {
// PHPUnit 10.1
$this->registerFailureType(PredictionException::class);
}
elseif (\is_string($classOrInterface)) {
// PHPUnit 9
\assert($this instanceof TestCase);
$this->recordDoubledType($classOrInterface);
}
return $this->getProphet()
->prophesize($classOrInterface);
}