From dd0bef1da7e508aeb6ff68f1ac269d87ba20c8e8 Mon Sep 17 00:00:00 2001 From: Sebastian Bergmann Date: Tue, 12 Dec 2023 08:07:31 +0100 Subject: [PATCH] Deprecate functionality removed in e84b162de6a84ca2f27ff6ff59e8ca51eb2793ee --- .psalm/baseline.xml | 7 +++++++ ChangeLog-10.5.md | 5 +++++ DEPRECATIONS.md | 1 + src/Framework/TestCase.php | 5 +++++ src/TextUI/Configuration/Configuration.php | 3 +++ src/TextUI/Configuration/Xml/PHPUnit.php | 3 +++ 6 files changed, 24 insertions(+) diff --git a/.psalm/baseline.xml b/.psalm/baseline.xml index 43e51480668..e775959927c 100644 --- a/.psalm/baseline.xml +++ b/.psalm/baseline.xml @@ -409,6 +409,8 @@ mockObjectForAbstractClass mockObjectForTrait objectForTrait + registerMockObjectsFromTestArguments + registerMockObjectsFromTestArguments getMethod @@ -425,6 +427,10 @@ output()]]> + + registerMockObjectsFromTestArgumentsRecursively + registerMockObjectsFromTestArgumentsRecursively + $var @@ -834,6 +840,7 @@ hasCacheResultFile hasCacheResultFile hasCoverageCacheDirectory + registerMockObjectsFromTestArgumentsRecursively baseline diff --git a/ChangeLog-10.5.md b/ChangeLog-10.5.md index 0db7c84fc90..e5122bc4f2c 100644 --- a/ChangeLog-10.5.md +++ b/ChangeLog-10.5.md @@ -4,6 +4,11 @@ All notable changes of the PHPUnit 10.5 release series are documented in this fi ## [10.5.3] - 2023-MM-DD +### Deprecated + +* `registerMockObjectsFromTestArgumentsRecursively` attribute on the `` element of the XML configuration file +* `PHPUnit\TextUI\Configuration\Configuration::registerMockObjectsFromTestArgumentsRecursively()` + ### Fixed * [#5614](https://github.com/sebastianbergmann/phpunit/issues/5614): Infinite recursion when data provider provides recursive array diff --git a/DEPRECATIONS.md b/DEPRECATIONS.md index cd7456b2690..85ba0930c84 100644 --- a/DEPRECATIONS.md +++ b/DEPRECATIONS.md @@ -74,6 +74,7 @@ This functionality is currently [soft-deprecated](https://phpunit.de/backward-co | | `PHPUnit\TextUI\Configuration\Configuration::cliArgument()` | 10.4.0 | `PHPUnit\TextUI\Configuration\Configuration::cliArguments()[0]` | | | `PHPUnit\TextUI\Configuration\Configuration::hasCliArgument()` | 10.4.0 | `PHPUnit\TextUI\Configuration\Configuration::hasCliArguments()` | | | `PHPUnit\Framework\Constraint\Constraint::exporter()` | 10.4.0 | | +| | `PHPUnit\TextUI\Configuration\Configuration::registerMockObjectsFromTestArgumentsRecursively()` | 10.5.3 | | ## Hard Deprecations diff --git a/src/Framework/TestCase.php b/src/Framework/TestCase.php index df996a045c3..51333014894 100644 --- a/src/Framework/TestCase.php +++ b/src/Framework/TestCase.php @@ -601,6 +601,8 @@ final public function expectsOutput(): bool /** * @internal This method is not covered by the backward compatibility promise for PHPUnit + * + * @deprecated */ final public function registerMockObjectsFromTestArgumentsRecursively(): void { @@ -1827,6 +1829,9 @@ private function shouldInvocationMockerBeReset(MockObject $mock): bool return !in_array($mock, $enumerator->enumerate($this->testResult), true); } + /** + * @deprecated + */ private function registerMockObjectsFromTestArguments(array $testArguments, Context $context = new Context): void { if ($this->registerMockObjectsFromTestArgumentsRecursively) { diff --git a/src/TextUI/Configuration/Configuration.php b/src/TextUI/Configuration/Configuration.php index 72cea86e9e2..ae18bbb6412 100644 --- a/src/TextUI/Configuration/Configuration.php +++ b/src/TextUI/Configuration/Configuration.php @@ -926,6 +926,9 @@ public function requireCoverageMetadata(): bool return $this->requireCoverageMetadata; } + /** + * @deprecated + */ public function registerMockObjectsFromTestArgumentsRecursively(): bool { return $this->registerMockObjectsFromTestArgumentsRecursively; diff --git a/src/TextUI/Configuration/Xml/PHPUnit.php b/src/TextUI/Configuration/Xml/PHPUnit.php index 6c3ddd649e3..febe11dfc1a 100644 --- a/src/TextUI/Configuration/Xml/PHPUnit.php +++ b/src/TextUI/Configuration/Xml/PHPUnit.php @@ -453,6 +453,9 @@ public function backupStaticProperties(): bool return $this->backupStaticProperties; } + /** + * @deprecated + */ public function registerMockObjectsFromTestArgumentsRecursively(): bool { return $this->registerMockObjectsFromTestArgumentsRecursively;