public function endTest(\PHPUnit_Framework_Test $test, $time) { if ($test instanceof Spec\TestCaseInterface) { $levels = 0; if ($parent = $test->getSuite()) { while ($parent = $parent->getParent()) { $levels++; } } $output = str_repeat(" ", $levels) . $test->getTitle(); if ($this->lastTestResult !== self::PASSED) { switch ($this->lastTestResult) { case self::FAILED: $output .= ' (FAILED - ' . count($this->exceptions) . ')'; $output = "[31m{$output}[0m"; break; case self::ERROR: $output .= ' (ERROR - ' . count($this->exceptions) . ')'; $output = "[31m{$output}[0m"; break; case self::INCOMPLETE: $output .= ' (INCOMPLETE)'; $output = "[30;1m{$output}[0m"; break; case self::SKIPPED: $output .= ' (SKIPPED)'; $output = "[30;1m{$output}[0m"; break; } } else { $output = "[32m" . $output . "[0m"; } $this->write($output . PHP_EOL); } }