PHPUnit registers an error handler that converts E_WARNING etc. to exceptions. This error handler can be configured through configuration directives such as convertWarningsToExceptions.
Internally, when convertWarningsToExceptions="false" is configured in phpunit.xml, for instance, PHPUnit\Framework\Error\Warning::$enabled is set to false. This is a legacy from the earliest days of PHPUnit and should be cleaned up.
The text was updated successfully, but these errors were encountered:
While working on this I learned that setUseErrorHandler() as well as an annotation @errorHandler exist for disabling the error handler for a specific test. According to Git (git log -S getErrorHandlerSettings --source --all) this was implemented for PHPUnit 3.4 back in 2009. Apparently it was never documented.