From 41966bdb99447590318ac01ebf8454e158241ae5 Mon Sep 17 00:00:00 2001 From: Sebastian Bergmann Date: Fri, 24 Feb 2023 07:30:08 +0100 Subject: [PATCH] Soft-deprecate getMockForTrait() for #5243 --- ChangeLog-10.1.md | 1 + src/Framework/TestCase.php | 2 ++ 2 files changed, 3 insertions(+) diff --git a/ChangeLog-10.1.md b/ChangeLog-10.1.md index c8a665fbc53..7664e6b0c83 100644 --- a/ChangeLog-10.1.md +++ b/ChangeLog-10.1.md @@ -15,5 +15,6 @@ All notable changes of the PHPUnit 10.1 release series are documented in this fi * [#5240](https://github.com/sebastianbergmann/phpunit/issues/5240): Deprecate `TestCase::createTestProxy()` (this method only has a `@deprecated` annotation for now; using this method will trigger a deprecation warning in PHPUnit 11; this method will be removed in PHPUnit 12) * [#5241](https://github.com/sebastianbergmann/phpunit/issues/5241): Deprecate `TestCase::getMockForAbstractClass()` (this method only has a `@deprecated` annotation for now; using this method will trigger a deprecation warning in PHPUnit 11; this method will be removed in PHPUnit 12) * [#5242](https://github.com/sebastianbergmann/phpunit/issues/5242): Deprecate `TestCase::getMockFromWsdl()` (this method only has a `@deprecated` annotation for now; using this method will trigger a deprecation warning in PHPUnit 11; this method will be removed in PHPUnit 12) +* [#5243](https://github.com/sebastianbergmann/phpunit/issues/5243): Deprecate `TestCase::getMockForTrait()` (this method only has a `@deprecated` annotation for now; using this method will trigger a deprecation warning in PHPUnit 11; this method will be removed in PHPUnit 12) [10.1.0]: https://github.com/sebastianbergmann/phpunit/compare/10.0...main diff --git a/src/Framework/TestCase.php b/src/Framework/TestCase.php index 258c37c3a8f..47fa107e2f8 100644 --- a/src/Framework/TestCase.php +++ b/src/Framework/TestCase.php @@ -1386,6 +1386,8 @@ protected function getMockFromWsdl(string $wsdlFile, string $originalClassName = * * @throws \PHPUnit\Framework\MockObject\Exception * @throws InvalidArgumentException + * + * @deprecated https://github.com/sebastianbergmann/phpunit/issues/5243 */ protected function getMockForTrait(string $traitName, array $arguments = [], string $mockClassName = '', bool $callOriginalConstructor = true, bool $callOriginalClone = true, bool $callAutoload = true, array $mockedMethods = [], bool $cloneArguments = false): MockObject {