You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
symfony/phpunit-bridge used to provide the Ignoring Deprecations feature, by means of which a deprecation error triggered during a test, that matches any pattern from a set defined in an ignore file, would be ignored and not reported.
In Drupal testing, we are making extensive use of this feature, to the point that when we started testing with PHPUnit 10, we developed our own replacement of the functionality.
The logic is that in large codebases with strong BC focus, we may incur in deprecations that would occur in thousands (for example, deprecations thrown by a debug classloader that check proper typehinting of extending classes), and it may be unlikely that fixing them will occur before next major release and/or with a single issue.
So it is much simpler just to ignore them and then remove the ignore pattern once it is no longer necessary.
symfony/phpunit-bridge and Drupal 11 own DeprecationHandler both achieve that by means of heavily replacing PHPUnit's error handler, which works but may not be a good idea long term.
A feature (note, not necessarily a blunt replacement of the ignore file, could be an event validating whether the single deprecation thrown should be ignored, or similar mechanisms) to allow selected deprecations to be skipped/ignored from the reporting, would help to remove those fillgaps.
The text was updated successfully, but these errors were encountered:
symfony/phpunit-bridge used to provide the Ignoring Deprecations feature, by means of which a deprecation error triggered during a test, that matches any pattern from a set defined in an ignore file, would be ignored and not reported.
In Drupal testing, we are making extensive use of this feature, to the point that when we started testing with PHPUnit 10, we developed our own replacement of the functionality.
The logic is that in large codebases with strong BC focus, we may incur in deprecations that would occur in thousands (for example, deprecations thrown by a debug classloader that check proper typehinting of extending classes), and it may be unlikely that fixing them will occur before next major release and/or with a single issue.
So it is much simpler just to ignore them and then remove the ignore pattern once it is no longer necessary.
symfony/phpunit-bridge and Drupal 11 own DeprecationHandler both achieve that by means of heavily replacing PHPUnit's error handler, which works but may not be a good idea long term.
A feature (note, not necessarily a blunt replacement of the ignore file, could be an event validating whether the single deprecation thrown should be ignored, or similar mechanisms) to allow selected deprecations to be skipped/ignored from the reporting, would help to remove those fillgaps.
The text was updated successfully, but these errors were encountered: