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
Labels
type/refactoring A refactoring that should be applied to make the code easier to understand and maintain
Milestone

Comments

@sebastianbergmann
Copy link
Owner

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 sebastianbergmann added the type/refactoring A refactoring that should be applied to make the code easier to understand and maintain label Jan 31, 2019
@sebastianbergmann sebastianbergmann added this to the PHPUnit 8.1 milestone Jan 31, 2019
@sebastianbergmann
Copy link
Owner Author

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.

@sebastianbergmann
Copy link
Owner Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/refactoring A refactoring that should be applied to make the code easier to understand and maintain
Projects
None yet
Development

No branches or pull requests

1 participant