Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up configuration of error handler #3503

Closed
sebastianbergmann opened this issue Jan 31, 2019 · 2 comments
Closed

Clean up configuration of error handler #3503

sebastianbergmann opened this issue Jan 31, 2019 · 2 comments
Assignees
Milestone

Comments

@sebastianbergmann
Copy link
Owner

@sebastianbergmann sebastianbergmann commented Jan 31, 2019

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.

@sebastianbergmann
Copy link
Owner Author

@sebastianbergmann sebastianbergmann commented Feb 7, 2019

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.

Loading

@sebastianbergmann
Copy link
Owner Author

@sebastianbergmann sebastianbergmann commented Jun 20, 2019

I started to work on this in the issue-3503/error-handler branch.

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant