-
-
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
Raising an exception from a test double's configured method does not work #4162
Comments
Thank you for your report. Please provide a minimal, self-contained, reproducing test case that shows the problem you are reporting. Without such a minimal, self-contained, reproducing test case I will not be able to investigate this issue. |
@sebastianbergmann investigating further to see if I can boil it down to that 👍 |
Just to be sure: with
you mean that your test works with PHPUnit 9.0.2 but does not work with PHPUnit 9.1.0? |
@sebastianbergmann exactly. I've made some progress. The test passes when I change the code to this: |
I tried boiling it down to a simple test but no luck I'm afraid :/ |
Leads to
And
This only happens with the exception in there. Seems like the exception resets the counter.
|
@sebastianbergmann thanks for looking into this so quickly! :) |
Summary
With the new 9.1.0 update, one of the tests in the laravel/framework test suite suddenly started to fail. I'm still uncertain what's causing this but thought to open this issue to make you aware and perhaps see if someone could help track down the change that's causing this.
Current behavior
We're now getting this failure:
Here's an example run: https://github.com/laravel/framework/runs/557414302?check_suite_focus=true
And here's the test in question: https://github.com/laravel/framework/blob/55189c1128d692e3abe194ea91b85377d1a1f5a5/tests/Database/DatabaseConnectionTest.php#L256-L269
How to reproduce
Install laravel/framework locally with PHPUnit 9.1.0 and run the above test using PHP 7.3
Expected behavior
The test was passing before PHPUnit 9.1.0 was released.
The text was updated successfully, but these errors were encountered: