What's the best way for me to check in PHPUnit whether my test execution succeeded or failed? I am trying to take a screenshot for my Selenium window, but only when my test has failed. I've tried taking a screenshot in onNotSuccessfulTest, but if I am always closing my window in tearDown() (which I should be doing), then there is no session to take the screenshot with in my onNotSuccessfulTest function.
The solution I'm thinking of involves checking for whether the test succeeded or failed in the tearDown, determining whether or not to take a screenshot.
I am using PHPUnit 3.6 and Facebook's php-webdriver, so as far as I know, I don't have the variable captureScreenshotOnFailure.
Thoughts?