Skip to content

Optionally (fail|stop) on (notice|deprecation) events #5196

@hemberger

Description

@hemberger

In PHPUnit 9, it was possible to get a non-zero exit code from phpunit if any tests encountered a warning, notice, or deprecation (with the proper configuration). This was very helpful for strictly prohibiting all error events.

I appreciate the distinction between test outcomes and test issues in PHPUnit 10, but I find myself missing the option for the process to return a non-zero exit code when there are any issues. This is still possible for warnings with failOnWarning, but it appears that no such option exists for notices or deprecations. Perhaps it would make sense to have boolean options failOnNotice and failOnDeprecation to fill this role? (This would also provide parity with the new displayDetailsOnTestsThatTrigger* options.)

If this functionality already exists, but I just missed it, my apologies! Thanks for all the work on PHPUnit 10. I'm very excited to start using it (especially for the code coverage color/css options, as a colorblind person).

Metadata

Metadata

Labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions