FIX check for suite existence in endCurrentTest

When using data providers with tests, the reporter appears to get confused and run callbacks in a weird order. This checks that the current suite before adding more details.
This commit is contained in:
Will Morgan 2014-12-04 14:48:10 +00:00
parent f17d594141
commit 00e029f574

View File

@ -242,7 +242,7 @@ class SapphireTestReporter implements PHPUnit_Framework_TestListener {
* Cleanly end the current test * Cleanly end the current test
*/ */
protected function endCurrentTest() { protected function endCurrentTest() {
if(!$this->currentTest) return; if(!$this->currentTest || !$this->currentSuite) return;
// Time the current test // Time the current test
$testDuration = microtime(true) - $this->startTestTime; $testDuration = microtime(true) - $this->startTestTime;