phpstan-deprecation-rules
phpstan-deprecation-rules copied to clipboard
Allow ignoring "@group legacy" annotated test methods when Symfony PHPUnit bridge is in use
It would be useful to allow skipping analysis of @legacy
annotated PHPUnit test methods test in PHPUnit.
Drupal runs deprecation tests via PHPUnit and the Symfony's PHPUnit bridge. Current policy for runtime deprecated code is to write a @legacy
annotated test that explicitly contains calls to deprecated code. PHPStan would now report these calls as errors, which is a duplicated check vs. existing tools. We cannot ignore entire files since it may well be that normal and deprecation tests are part of the same test class.
See also:
- https://www.drupal.org/project/drupal/issues/3262937
- https://www.drupal.org/project/drupal/issues/3263109#comment-14402473