Skip to content
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 in tearDown should affect $this->getStatus() #2236

Closed
rtwo opened this issue Jul 6, 2016 · 5 comments · Fixed by N0rthernL1ghts/eloquent-bootstrap#2 or Zemhart/project_UAS_PHP#20
Labels
type/bug Something is broken

Comments

@rtwo
Copy link

rtwo commented Jul 6, 2016

Currently if a Tests throws an Exception in its tearDown function $this->getStatus() will still be 0 and i.e. TestListeners would assume the Tests to be successful.

The following Code should be moved down until after the last occurrence of $_e = ...

https://github.com/sebastianbergmann/phpunit/blob/master/src/Framework/TestCase.php#L971

@sebastianbergmann
Copy link
Owner

The link is no longer pointing to the correct line. Can you please send a pull request that implements the change you propose? Thanks!

@sebastianbergmann
Copy link
Owner

@rtwo ping?

@sebastianbergmann sebastianbergmann added the type/bug Something is broken label Oct 14, 2017
@rtwo
Copy link
Author

rtwo commented Oct 17, 2017

Sorry, I missed your first reply. I am a bit busy atm but I will try to look into it.

@ekharchenko-avito
Copy link

This patch broke our cleanup logic based on knowledge of test status in tearDown method 😞

@epdenouden
Copy link
Contributor

I poked around in the tearDown logic, I'll have a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment