diff --git a/src/Framework/TestCase.php b/src/Framework/TestCase.php index ace47a3c66f..cf8f66beba0 100644 --- a/src/Framework/TestCase.php +++ b/src/Framework/TestCase.php @@ -67,6 +67,7 @@ use PHPUnit\Framework\Constraint\ExceptionCode; use PHPUnit\Framework\Constraint\ExceptionMessageIsOrContains; use PHPUnit\Framework\Constraint\ExceptionMessageMatchesRegularExpression; +use PHPUnit\Framework\MockObject\Exception as MockObjectException; use PHPUnit\Framework\MockObject\Generator\Generator as MockGenerator; use PHPUnit\Framework\MockObject\MockBuilder; use PHPUnit\Framework\MockObject\MockObject; @@ -1220,7 +1221,7 @@ protected function setLocale(mixed ...$arguments): void * @psalm-return MockObject&RealInstanceType * * @throws InvalidArgumentException - * @throws MockObject\Exception + * @throws MockObjectException * @throws NoPreviousThrowableException */ protected function createMock(string $originalClassName): MockObject @@ -1247,7 +1248,7 @@ protected function createMock(string $originalClassName): MockObject /** * @psalm-param list $interfaces * - * @throws MockObject\Exception + * @throws MockObjectException */ protected function createMockForIntersectionOfInterfaces(array $interfaces): MockObject { @@ -1272,7 +1273,7 @@ protected function createMockForIntersectionOfInterfaces(array $interfaces): Moc * @psalm-return MockObject&RealInstanceType * * @throws InvalidArgumentException - * @throws MockObject\Exception + * @throws MockObjectException * @throws NoPreviousThrowableException */ protected function createConfiguredMock(string $originalClassName, array $configuration): MockObject @@ -1298,7 +1299,7 @@ protected function createConfiguredMock(string $originalClassName, array $config * @psalm-return MockObject&RealInstanceType * * @throws InvalidArgumentException - * @throws MockObject\Exception + * @throws MockObjectException */ protected function createPartialMock(string $originalClassName, array $methods): MockObject { @@ -1328,7 +1329,7 @@ protected function createPartialMock(string $originalClassName, array $methods): * @psalm-return MockObject&RealInstanceType * * @throws InvalidArgumentException - * @throws MockObject\Exception + * @throws MockObjectException * * @deprecated https://github.com/sebastianbergmann/phpunit/issues/5240 */ @@ -1359,7 +1360,7 @@ protected function createTestProxy(string $originalClassName, array $constructor * @psalm-return MockObject&RealInstanceType * * @throws InvalidArgumentException - * @throws MockObject\Exception + * @throws MockObjectException * * @deprecated https://github.com/sebastianbergmann/phpunit/issues/5241 */ @@ -1389,7 +1390,7 @@ protected function getMockForAbstractClass(string $originalClassName, array $arg /** * Creates a mock object based on the given WSDL file. * - * @throws MockObject\Exception + * @throws MockObjectException * * @deprecated https://github.com/sebastianbergmann/phpunit/issues/5242 */ @@ -1446,7 +1447,7 @@ protected function getMockFromWsdl(string $wsdlFile, string $originalClassName = * @psalm-param trait-string $traitName * * @throws InvalidArgumentException - * @throws MockObject\Exception + * @throws MockObjectException * * @deprecated https://github.com/sebastianbergmann/phpunit/issues/5243 */ @@ -1475,7 +1476,7 @@ protected function getMockForTrait(string $traitName, array $arguments = [], str * * @psalm-param trait-string $traitName * - * @throws MockObject\Exception + * @throws MockObjectException * * @deprecated https://github.com/sebastianbergmann/phpunit/issues/5244 */ @@ -2371,7 +2372,7 @@ private function hasExpectationOnOutput(): bool * @psalm-return Stub&RealInstanceType * * @throws InvalidArgumentException - * @throws MockObject\Exception + * @throws MockObjectException * @throws NoPreviousThrowableException */ protected static function createStub(string $originalClassName): Stub @@ -2396,7 +2397,7 @@ protected static function createStub(string $originalClassName): Stub /** * @psalm-param list $interfaces * - * @throws MockObject\Exception + * @throws MockObjectException */ protected static function createStubForIntersectionOfInterfaces(array $interfaces): Stub { @@ -2417,7 +2418,7 @@ protected static function createStubForIntersectionOfInterfaces(array $interface * @psalm-return Stub&RealInstanceType * * @throws InvalidArgumentException - * @throws MockObject\Exception + * @throws MockObjectException * @throws NoPreviousThrowableException */ final protected static function createConfiguredStub(string $originalClassName, array $configuration): Stub