-
-
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
TestCase::expectError works on PHP 7.3 but not on PHP 7.4/8.0 #4663
Comments
…ctError` Workaround implemented until phpunit bug is properly discovered: sebastianbergmann/phpunit#4663 Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
…ctError` Workaround implemented until phpunit bug is properly discovered: sebastianbergmann/phpunit#4663 Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
Thank you for bringing this to my attention. There seems to have been a change to how error handlers work and/or how errors are raised between PHP 7.3 and PHP 7.4 that I was not aware of so far. Here is a minimal reproducing example extracted from PHPUnit:
|
Nothing changed in general, but specifically to how |
Thanks for the insights Sebastian! |
Summary
Hey there, I have a unit test which verifies if an error is being thrown. I am using
TestCase::expectError
for this, which actually works when executing unit tests with PHP 7.3.When executing unit tests with PHP 7.4 or PHP 8.0, the test fails.
Current behavior
How to reproduce
Expected behavior
I'd expect that the unit test will pass on all PHP versions (7.3, 7.4 & 8.0).
The text was updated successfully, but these errors were encountered: