Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
* @expectedDeprecationMessage Use of the /migration_templates directory to store migration configuration files is deprecated in Drupal 8.1.0 and will be removed before Drupal 9.0.0.
… but @expectedDeprecationMessage
is not supported, only @expectedDeprecation
is.
Proposed resolution
TBD.
Remaining tasks
Step 1: figure out why this still passes tests.
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#5 | 2928645-5.patch | 1.03 KB | alexpott |
Comments
Comment #2
alexpottI think you might find that the annotation parser used is quite loose so it just finds @expectedDeprecation and it works just fine...
Comment #3
alexpottHmmm nope - it's just ignoring the expectedDeprecation completely. It needs the @legacy but there's other stuff not happening when @expectedDeprecation is stuff. My guess is that this is a bug with Symfony and how the deprecation stuff works when process isolation is on as it is in KernelTestBase.
Comment #4
alexpottWell actually if you fix it to use @expectedDeprecation then it works as expected - the test currently fails cause the message has been updated to include the change record but the question is why is the @group legacy enough...
Comment #5
alexpottHere's a patch.
Comment #6
dawehnerIt is a bit sad that it cannot use an explicit API like PHPUnit does now. Otherwise this would have been detected already.
Comment #7
Wim LeersYep,
setExpectedDeprecation()
would've been better.I think we need to understand this first before we commit this?
Comment #8
dawehnerWell, I'm quite sure that there is a reason:
\Symfony\Bridge\PhpUnit\DeprecationErrorHandler::register
needs to run before the actual test is executed, which is the place, where you can just parse annotations and not look at the actual code.Comment #9
Wim LeersI guess what we really want is for PHPUnit to have explicit support for this, rather than it being something added by Symfony?
Comment #10
alexpott@Wim Leers I guess that might be nice. Considering phpunit mock objects now do the
@trigger_error()
thing there might be scope to add this to PHPUnit. See https://github.com/sebastianbergmann/phpunit-mock-objects/issues/271Comment #14
Mile23The test passes because it's annotated
@group legacy
, and then the annotation is ignored. That's why it says:Legacy deprecation notices (6)
After the patch you don't get this message, and you just get a passing test.
Therefore, RTBC.
Moving to 8.7.x because it's a test improvement.
Comment #15
catchCommitted 79cb8c4 and pushed to 8.8.x. Thanks!