Closed (fixed)
Project:
Drupal core
Version:
8.8.x-dev
Component:
phpunit
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
5 Dec 2017 at 15:40 UTC
Updated:
30 Apr 2019 at 06:39 UTC
Jump to comment: Most recent, Most recent file
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::registerneeds 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!