phpstan-deprecation-rules icon indicating copy to clipboard operation
phpstan-deprecation-rules copied to clipboard

Allow ignoring "@group legacy" annotated test methods when Symfony PHPUnit bridge is in use

Open mondrake opened this issue 2 years ago • 8 comments

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

mondrake avatar Feb 11 '22 09:02 mondrake