Problem/Motivation
The approach to add a silenced deprecation in #3546029: Ensure that #[RunTestsInSeparateProcesses] attribute is added to all Kernel tests and #3550335: Ensure that #[RunTestsInSeparateProcesses] attribute is added to all Functional tests does not work if the test ignores deprecations.
Steps to reproduce
See \Drupal\Tests\system\Kernel\Theme\ThemeEngineTest
Proposed resolution
Add a PHPStan rule - can also ensure we have a group too which at least used to be necessary for run-tests to actually run the test.
Remaining tasks
User interface changes
None
Introduced terminology
N/a
API changes
None
Data model changes
None
Release notes snippet
N/a
Issue fork drupal-3556315
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3556315-current-approach-to
changes, plain diff MR !13701
Comments
Comment #2
alexpottComment #4
alexpottComment #5
mondrakeGood catch.
Few comments:
1) this is now partially overlapping with #3548982: Enforce removal of PHPUnit annotations from test classes' class metadata, in the sense that it analyses same scope with slightly different checks. May be better try to have one rule only?
2) the check on #[Group] attribute presence here is limited to Functional and Kernel tests AFAICS - should be on any test class actually
Comment #6
mondrakeComment #7
alexpottYep let's merge with the rule created by #3548982: Enforce removal of PHPUnit annotations from test classes' class metadata which I've just merged... good idea @mondrake and yes the group attribute should be on all tests.
The other question is what about the deprecation... I think we need to leave it there for contrib - but we should consider changing it to a E_USER_NOTICE and not silencing it - but let's tackle that in a separate issue.
Comment #8
alexpottAddressed #5
Comment #9
mondrakeCool.
Comment #10
mondrakeComment #12
catchCommitted/pushed to 11.x and cherry-picked to 11.3.x, thanks!