-
-
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
Exceptions raised in TestCase::tearDown() are not handled correctly #5210
Comments
I can reproduce this:
|
Thanks for the quick response. I understand the point of using |
Summary
Any exception thrown during the tear down is not reflected as an error on the test result nor the test is mark as failed.
I detected this due the use of the tear down to perform the check for Mockery with the
Mockery::close()
even when I expected the test to fail, the test is still passing which is wrong. After investigating detected that is not a mockery issue since is throwing the exception as expected but phpunit is not reporting the error.Current behavior
Test are passing even when during the
tearDown
of the test an exception is throw.How to reproduce
Create a simple test which during the tear down throw an exception
Expected behavior
The tests should fail with the message provided by the exception.
The text was updated successfully, but these errors were encountered: