Closed hemberger closed 1 year ago
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 convertDeprecationsToExceptions
were failing only on deprecations
trigger_error('User Deprecation', \E_USER_DEPRECATED);
but not on
@trigger_error('User Deprecation', \E_USER_DEPRECATED);
Currently PHPUnit 10 consider both the same way
OK, but some tests have issues!
Tests: 1, Assertions: 4, Deprecations: 1.
So if we just add an option failOnDeprecation
we won't get back the same behavior than the one in PHPUnit 9...
So if we just add an option failOnDeprecation we won't get back the same behavior than the one in PHPUnit 9.
Please do not mix unrelated topics and post similar comments on different issues.
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).