You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR was merged into the 7.2 branch.
Discussion
----------
[PhpUnitBridge] Add `ExpectUserDeprecationMessageTrait`
| Q | A
| ------------- | ---
| Branch? | 7.2
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Issues | Part of #49069, replaces #54538
| License | MIT
PHPUnit 11 introduces a method `expectUserDeprecationMessage()` which lets us define which deprecation messages we expect the tested code to raise. This new method can replace our own `expectDeprecation()` method once we upgrade to PHPUnit 11.
This PR introduces a `ExpectUserDeprecationMessageTrait` that polyfills this method for older PHPUnit versions. This allowed me to run all tests that I've migrated to `expectUserDeprecationMessage()` with PHPUnit 11.
Commits
-------
2485e15d9d [PhpUnitBridge] Add ExpectUserDeprecationMessageTrait
@@ -347,7 +347,7 @@ public function testIndirectCircularReferenceShouldThrowAnException()
347
347
*/
348
348
publicfunctiontestDeprecatedAlias()
349
349
{
350
-
$this->expectDeprecation('Since foo/bar 1.0.0: The "b" route alias is deprecated. You should stop using it, as it will be removed in the future.');
350
+
$this->expectUserDeprecationMessage('Since foo/bar 1.0.0: The "b" route alias is deprecated. You should stop using it, as it will be removed in the future.');
@@ -811,7 +811,7 @@ public function testAliasWhichTargetRouteDoesntExist()
811
811
*/
812
812
publicfunctiontestDeprecatedAlias()
813
813
{
814
-
$this->expectDeprecation('Since foo/bar 1.0.0: The "b" route alias is deprecated. You should stop using it, as it will be removed in the future.');
814
+
$this->expectUserDeprecationMessage('Since foo/bar 1.0.0: The "b" route alias is deprecated. You should stop using it, as it will be removed in the future.');
815
815
816
816
$routes = newRouteCollection();
817
817
$routes->add('a', newRoute('/foo'));
@@ -826,7 +826,7 @@ public function testDeprecatedAlias()
0 commit comments