diff --git a/.psalm/baseline.xml b/.psalm/baseline.xml
index e775959927c..8ab36b71943 100644
--- a/.psalm/baseline.xml
+++ b/.psalm/baseline.xml
@@ -30,6 +30,25 @@
$message
$message
+
+ exportObjects)]]>
+ exportObjects)]]>
+ exportObjects)]]>
+ telemetryInfo(),
+ Exporter::export($value, $this->exportObjects),
+ $constraint->toString($this->exportObjects),
+ $constraint->count(),
+ $message,
+ )]]>
+ telemetryInfo(),
+ Exporter::export($value, $this->exportObjects),
+ $constraint->toString($this->exportObjects),
+ $constraint->count(),
+ $message,
+ )]]>
+
toString
toString
@@ -37,6 +56,16 @@
toString
+
+
+ AssertionFailed
+
+
+
+
+ AssertionSucceeded
+
+
$calledMethods
@@ -86,6 +115,13 @@
+
+ Test\AssertionFailed::class
+ Test\AssertionSucceeded::class
+
+
+ exportObjects
+
@@ -138,6 +174,16 @@
hasDataFromDataProvider
+
+
+ dependencyInput(), EventFacade::emitter()->exportsObjects())]]>
+ providedData(), EventFacade::emitter()->exportsObjects())]]>
+
+
+ exportsObjects
+ exportsObjects
+
+
$className
@@ -147,6 +193,12 @@
name()]]>
+
+
+ testAssertionFailed
+ testAssertionSucceeded
+
+
Assert::assertStringNotMatchesFormat(...func_get_args())
@@ -183,21 +235,76 @@
getCode()]]>
+
+
+ value, $exportObjects)]]>
+
+
toString
+
+
+ value, $exportObjects)]]>
+
+
+
+ Exporter::export($other, true)
+ Exporter::export($other, true)
+
toString
toString
+
+
+ value, $exportObjects)]]>
+
+
+
+
+ value, $exportObjects)]]>
+
+
+
+
+ value, $exportObjects)]]>
+
+
+
+
+ value, $exportObjects)]]>
+
+
+
+
+ Exporter::export($other, true)
+ expectedCode, true)]]>
+
+
+
+
+ expectedMessage)]]>
+
+
regularExpression]]>
+
+ regularExpression)]]>
+
+
+
+
+ Exporter::export($other, true)
+ value, $exportObjects)]]>
+ value, true)]]>
+
@@ -235,6 +342,9 @@
+
+ Exporter::export($other, true)
+
toString
@@ -248,6 +358,9 @@
+
+ key)]]>
+
toString
@@ -257,6 +370,11 @@
toString
+
+
+ value, $exportObjects)]]>
+
+
$type
@@ -428,6 +546,7 @@
output()]]>
+ exportsObjects
registerMockObjectsFromTestArgumentsRecursively
registerMockObjectsFromTestArgumentsRecursively
@@ -751,6 +870,11 @@
generateBaseline()]]>
+
+ exportObjects
+ exportObjects
+ requiresExportOfObjects
+
nameAndVersion
diff --git a/ChangeLog-10.5.md b/ChangeLog-10.5.md
index e5122bc4f2c..f22ac72edec 100644
--- a/ChangeLog-10.5.md
+++ b/ChangeLog-10.5.md
@@ -6,6 +6,8 @@ All notable changes of the PHPUnit 10.5 release series are documented in this fi
### Deprecated
+* `Test\AssertionFailed` and `Test\AssertionSucceeded` events
+* `PHPUnit\Runner\Extension\Facade::requireExportOfObjects()` and `PHPUnit\Runner\Extension\Facade::requiresExportOfObjects()`
* `registerMockObjectsFromTestArgumentsRecursively` attribute on the `` element of the XML configuration file
* `PHPUnit\TextUI\Configuration\Configuration::registerMockObjectsFromTestArgumentsRecursively()`
diff --git a/DEPRECATIONS.md b/DEPRECATIONS.md
index 85ba0930c84..d66cef7e454 100644
--- a/DEPRECATIONS.md
+++ b/DEPRECATIONS.md
@@ -60,21 +60,23 @@ This functionality is currently [soft-deprecated](https://phpunit.de/backward-co
### Extending PHPUnit
-| Issue | Description | Since | Replacement |
-|-------|--------------------------------------------------------------------------------------------------------|--------|--------------------------------------------------------------------------------|
-| | `PHPUnit\TextUI\Configuration\Configuration::coverageExcludeDirectories()` | 10.2.0 | `PHPUnit\TextUI\Configuration\Configuration::source()->excludeDirectories()` |
-| | `PHPUnit\TextUI\Configuration\Configuration::coverageExcludeFiles()` | 10.2.0 | `PHPUnit\TextUI\Configuration\Configuration::source()->excludeFiles()` |
-| | `PHPUnit\TextUI\Configuration\Configuration::coverageIncludeDirectories()` | 10.2.0 | `PHPUnit\TextUI\Configuration\Configuration::source()->includeDirectories()` |
-| | `PHPUnit\TextUI\Configuration\Configuration::coverageIncludeFiles()` | 10.2.0 | `PHPUnit\TextUI\Configuration\Configuration::source()->includeFiles()` |
-| | `PHPUnit\TextUI\Configuration\Configuration::loadPharExtensions()` | 10.2.0 | `PHPUnit\TextUI\Configuration\Configuration::noExtensions()` |
-| | `PHPUnit\TextUI\Configuration\Configuration::hasNonEmptyListOfFilesToBeIncludedInCodeCoverageReport()` | 10.2.0 | `PHPUnit\TextUI\Configuration\Configuration::source()->notEmpty()` |
-| | `PHPUnit\TextUI\Configuration\Configuration::restrictDeprecations()` | 10.2.0 | `PHPUnit\TextUI\Configuration\Configuration::source()->restrictDeprecations()` |
-| | `PHPUnit\TextUI\Configuration\Configuration::restrictNotices()` | 10.2.0 | `PHPUnit\TextUI\Configuration\Configuration::source()->restrictNotices()` |
-| | `PHPUnit\TextUI\Configuration\Configuration::restrictWarnings()` | 10.2.0 | `PHPUnit\TextUI\Configuration\Configuration::source()->restrictWarnings()` |
-| | `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 | |
+| Issue | Description | Since | Replacement |
+|-------|------------------------------------------------------------------------------------------------------------------------------|--------|--------------------------------------------------------------------------------|
+| | `PHPUnit\TextUI\Configuration\Configuration::coverageExcludeDirectories()` | 10.2.0 | `PHPUnit\TextUI\Configuration\Configuration::source()->excludeDirectories()` |
+| | `PHPUnit\TextUI\Configuration\Configuration::coverageExcludeFiles()` | 10.2.0 | `PHPUnit\TextUI\Configuration\Configuration::source()->excludeFiles()` |
+| | `PHPUnit\TextUI\Configuration\Configuration::coverageIncludeDirectories()` | 10.2.0 | `PHPUnit\TextUI\Configuration\Configuration::source()->includeDirectories()` |
+| | `PHPUnit\TextUI\Configuration\Configuration::coverageIncludeFiles()` | 10.2.0 | `PHPUnit\TextUI\Configuration\Configuration::source()->includeFiles()` |
+| | `PHPUnit\TextUI\Configuration\Configuration::loadPharExtensions()` | 10.2.0 | `PHPUnit\TextUI\Configuration\Configuration::noExtensions()` |
+| | `PHPUnit\TextUI\Configuration\Configuration::hasNonEmptyListOfFilesToBeIncludedInCodeCoverageReport()` | 10.2.0 | `PHPUnit\TextUI\Configuration\Configuration::source()->notEmpty()` |
+| | `PHPUnit\TextUI\Configuration\Configuration::restrictDeprecations()` | 10.2.0 | `PHPUnit\TextUI\Configuration\Configuration::source()->restrictDeprecations()` |
+| | `PHPUnit\TextUI\Configuration\Configuration::restrictNotices()` | 10.2.0 | `PHPUnit\TextUI\Configuration\Configuration::source()->restrictNotices()` |
+| | `PHPUnit\TextUI\Configuration\Configuration::restrictWarnings()` | 10.2.0 | `PHPUnit\TextUI\Configuration\Configuration::source()->restrictWarnings()` |
+| | `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 | |
+| | `Test\AssertionFailed` and `Test\AssertionSucceeded` events | 10.5.3 | |
+| | `PHPUnit\Runner\Extension\Facade::requireExportOfObjects()` and `PHPUnit\Runner\Extension\Facade::requiresExportOfObjects()` | 10.5.3 | |
## Hard Deprecations
diff --git a/src/Event/Emitter/DispatchingEmitter.php b/src/Event/Emitter/DispatchingEmitter.php
index 50764ada1fd..2f9f97e53bb 100644
--- a/src/Event/Emitter/DispatchingEmitter.php
+++ b/src/Event/Emitter/DispatchingEmitter.php
@@ -45,11 +45,17 @@ public function __construct(Dispatcher $dispatcher, Telemetry\System $system)
$this->previousSnapshot = $system->snapshot();
}
+ /**
+ * @deprecated
+ */
public function exportObjects(): void
{
$this->exportObjects = true;
}
+ /**
+ * @deprecated
+ */
public function exportsObjects(): bool
{
return $this->exportObjects;
@@ -477,6 +483,8 @@ public function testRegisteredComparator(string $className): void
/**
* @throws InvalidArgumentException
* @throws UnknownEventTypeException
+ *
+ * @deprecated
*/
public function testAssertionSucceeded(mixed $value, Constraint\Constraint $constraint, string $message): void
{
@@ -494,6 +502,8 @@ public function testAssertionSucceeded(mixed $value, Constraint\Constraint $cons
/**
* @throws InvalidArgumentException
* @throws UnknownEventTypeException
+ *
+ * @deprecated
*/
public function testAssertionFailed(mixed $value, Constraint\Constraint $constraint, string $message): void
{
diff --git a/src/Event/Emitter/Emitter.php b/src/Event/Emitter/Emitter.php
index 5116ca121fc..cacfe72a909 100644
--- a/src/Event/Emitter/Emitter.php
+++ b/src/Event/Emitter/Emitter.php
@@ -21,8 +21,14 @@
*/
interface Emitter
{
+ /**
+ * @deprecated
+ */
public function exportObjects(): void;
+ /**
+ * @deprecated
+ */
public function exportsObjects(): bool;
public function applicationStarted(): void;
@@ -109,8 +115,14 @@ public function testPrepared(Code\Test $test): void;
*/
public function testRegisteredComparator(string $className): void;
+ /**
+ * @deprecated
+ */
public function testAssertionSucceeded(mixed $value, Constraint\Constraint $constraint, string $message): void;
+ /**
+ * @deprecated
+ */
public function testAssertionFailed(mixed $value, Constraint\Constraint $constraint, string $message): void;
/**
diff --git a/src/Event/Events/Test/Assertion/AssertionFailed.php b/src/Event/Events/Test/Assertion/AssertionFailed.php
index cab77823715..68954f20716 100644
--- a/src/Event/Events/Test/Assertion/AssertionFailed.php
+++ b/src/Event/Events/Test/Assertion/AssertionFailed.php
@@ -15,6 +15,8 @@
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ *
+ * @deprecated
*/
final class AssertionFailed implements Event
{
diff --git a/src/Event/Events/Test/Assertion/AssertionFailedSubscriber.php b/src/Event/Events/Test/Assertion/AssertionFailedSubscriber.php
index a14cd5f5e78..c569bcc2221 100644
--- a/src/Event/Events/Test/Assertion/AssertionFailedSubscriber.php
+++ b/src/Event/Events/Test/Assertion/AssertionFailedSubscriber.php
@@ -13,6 +13,8 @@
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ *
+ * @deprecated
*/
interface AssertionFailedSubscriber extends Subscriber
{
diff --git a/src/Event/Events/Test/Assertion/AssertionSucceeded.php b/src/Event/Events/Test/Assertion/AssertionSucceeded.php
index 405753e8ec8..d4f8548412f 100644
--- a/src/Event/Events/Test/Assertion/AssertionSucceeded.php
+++ b/src/Event/Events/Test/Assertion/AssertionSucceeded.php
@@ -15,6 +15,8 @@
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ *
+ * @deprecated
*/
final class AssertionSucceeded implements Event
{
diff --git a/src/Event/Events/Test/Assertion/AssertionSucceededSubscriber.php b/src/Event/Events/Test/Assertion/AssertionSucceededSubscriber.php
index 535860a382d..59d72c0f015 100644
--- a/src/Event/Events/Test/Assertion/AssertionSucceededSubscriber.php
+++ b/src/Event/Events/Test/Assertion/AssertionSucceededSubscriber.php
@@ -13,6 +13,8 @@
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ *
+ * @deprecated
*/
interface AssertionSucceededSubscriber extends Subscriber
{
diff --git a/src/Runner/Extension/Facade.php b/src/Runner/Extension/Facade.php
index 62ba4b23427..b168eb6222e 100644
--- a/src/Runner/Extension/Facade.php
+++ b/src/Runner/Extension/Facade.php
@@ -92,11 +92,17 @@ public function requiresCodeCoverageCollection(): bool
return $this->requiresCodeCoverageCollection;
}
+ /**
+ * @deprecated
+ */
public function requireExportOfObjects(): void
{
$this->requiresExportOfObjects = true;
}
+ /**
+ * @deprecated
+ */
public function requiresExportOfObjects(): bool
{
return $this->requiresExportOfObjects;
diff --git a/src/Util/Exporter.php b/src/Util/Exporter.php
index dfb375828b5..8906626ddca 100644
--- a/src/Util/Exporter.php
+++ b/src/Util/Exporter.php
@@ -15,6 +15,8 @@
/**
* @internal This class is not covered by the backward compatibility promise for PHPUnit
+ *
+ * @deprecated
*/
final class Exporter
{