-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Optionally (fail|stop) on (notice|deprecation) events #5196
Comments
The major functional changes from 9.5 to 10.0 are: * Annotations are converted to attributes. * Data providers must now be static. Many data provider functions are converted to `TestWith` attributes. These are safer now as attributes, because they can contain real PHP objects (previously they had to be a JSON representation). When the data sets are trivial, this is much simpler and more compact. PHPUnit no longer returns non-zero exit code on notices/deprecations, though they will still be printed in the results due to the use of the `displayDetailsOnTestsThatTrigger*` settings. For more info, see: sebastianbergmann/phpunit#5196 All tests are upgraded using the PHPUNIT_100 rector ruleset. It didn't work perfectly, so some manual fixes were necessary. Add custom CSS for phpunit HTML code coverage. This uses dark-mode and colorblind-friendly colors.
The major functional changes from 9.5 to 10.0 are: * Annotations are converted to attributes. * Data providers must now be static. Many data provider functions are converted to `TestWith` attributes. These are safer now as attributes, because they can contain real PHP objects (previously they had to be a JSON representation). When the data sets are trivial, this is much simpler and more compact. PHPUnit no longer returns non-zero exit code on notices/deprecations, though they will still be printed in the results due to the use of the `displayDetailsOnTestsThatTrigger*` settings. For more info, see: sebastianbergmann/phpunit#5196 All tests are upgraded using the PHPUNIT_100 rector ruleset. It didn't work perfectly, so some manual fixes were necessary. Add custom CSS for phpunit HTML code coverage. This uses dark-mode and colorblind-friendly colors.
While I understand the logic for deprecations, I would still appreciate an option to fail on notices. A library that triggers notices when using it will often be considered bad as many frameworks turn notices into exceptions in dev mode. |
In PHPUnit 9, the option
but not on
Currently PHPUnit 10 consider both the same way
So if we just add an option |
Please do not mix unrelated topics and post similar comments on different issues. |
This functionality was lost in PHPUnit 10.0, but was re-added via these configuration options in PHPUnit 10.1. See sebastianbergmann/phpunit#5196.
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 optionsfailOnNotice
andfailOnDeprecation
to fill this role? (This would also provide parity with the newdisplayDetailsOnTestsThatTrigger*
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).
The text was updated successfully, but these errors were encountered: