Skip to content

Commit d5db219

Browse files
hkdobrevfabpot
authored andcommitted
[PhpUnitBridge] Deprecate @expectedDeprecation annotation
1 parent 197b04e commit d5db219

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ CHANGELOG
77
* ignore verbosity settings when the build fails because of deprecations
88
* added per-group verbosity
99
* added `ExpectDeprecationTrait` to be able to define an expected deprecation from inside a test
10+
* deprecated the `@expectedDeprecation` annotation, use the `ExpectDeprecationTrait::expectDeprecation()` method instead
1011

1112
5.0.0
1213
-----

Legacy/SymfonyTestsListenerTrait.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ public function startTest($test)
226226
if (isset($annotations['method']['expectedDeprecation'])) {
227227
self::$expectedDeprecations = $annotations['method']['expectedDeprecation'];
228228
self::$previousErrorHandler = set_error_handler([self::class, 'handleError']);
229+
@trigger_error('Since symfony/phpunit-bridge 5.1: Using "@expectedDeprecation" annotations in tests is deprecated, use the "ExpectDeprecationTrait::expectDeprecation()" method instead.', E_USER_DEPRECATED);
229230
}
230231

231232
if ($this->checkNumAssertions) {

0 commit comments

Comments
 (0)