-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
PHPUnit 13.2 breaks Drupal's approach for ignoring deprecations #6705
Copy link
Copy link
Open
Labels
feature/issuesIssues related to handling of `E_*` emitted by the PHP runtime and `E_USER_*` emitted in PHP codeIssues related to handling of `E_*` emitted by the PHP runtime and `E_USER_*` emitted in PHP codefeature/test-runnerCLI test runnerCLI test runnertype/bugSomething is brokenSomething is brokenversion/13Something affects PHPUnit 13Something affects PHPUnit 13
Metadata
Metadata
Assignees
Labels
feature/issuesIssues related to handling of `E_*` emitted by the PHP runtime and `E_USER_*` emitted in PHP codeIssues related to handling of `E_*` emitted by the PHP runtime and `E_USER_*` emitted in PHP codefeature/test-runnerCLI test runnerCLI test runnertype/bugSomething is brokenSomething is brokenversion/13Something affects PHPUnit 13Something affects PHPUnit 13
Summary
PHPUnit 13.2.0 breaks Drupal deprecation ignore process, that is based on the assumption that an error handler set in the bootstrap PHP file is the one active during the testing.
What we are doing in Drupal is we set in bootstrap the
\Drupal\TestTools\ErrorHandler\BootstrapErrorHandlerwhich itself falls back to PHPUnit's own one. So we can exclude some deprecations to be ignored (we ignore via a file containing a set of patterns to be ignored) and return to test execution without even letting PHPUnit know that a deprecation was triggered.13.2 reverses that - it always sets its own error handler as the main one, and only falls back to
\Drupal\TestTools\ErrorHandler\BootstrapErrorHandlerafter the error (including deprecation ones) have been already collected. So deprecations get through to PHPUnit and are reported.Current behavior
How to reproduce
Expected behavior