/**
  * Called when a test run finishes.
  *
  * @param   unittest.TestSuite suite
  * @param   unittest.TestResult result
  * @param  unittest.StopTests $stop
  */
 public function testRunFinished(\unittest\TestSuite $suite, \unittest\TestResult $result, \unittest\StopTests $stopped = null)
 {
     // Details
     if ($result->successCount() > 0) {
         $this->out->writeLine("\n---> Succeeeded:");
         foreach (array_keys($result->succeeded) as $key) {
             $this->out->writeLine('* ', $result->succeeded[$key]);
         }
     }
     if ($result->skipCount() > 0) {
         $this->out->writeLine("\n---> Skipped:");
         foreach (array_keys($result->skipped) as $key) {
             $this->out->writeLine('* ', $result->skipped[$key]);
         }
     }
     if ($result->failureCount() > 0) {
         $this->out->writeLine("\n---> Failed:");
         foreach (array_keys($result->failed) as $key) {
             $this->out->writeLine('* ', $result->failed[$key]);
         }
     }
     $this->out->writeLinef("\n===> %s: %d run (%d skipped), %d succeeded, %d failed", $stopped ? 'STOP ' . $stopped->getMessage() : ($result->failureCount() ? 'FAIL' : 'OK'), $result->runCount(), $result->skipCount(), $result->successCount(), $result->failureCount());
     $this->out->writeLinef('===> Memory used: %.2f kB (%.2f kB peak)', Runtime::getInstance()->memoryUsage() / 1024, Runtime::getInstance()->peakMemoryUsage() / 1024);
     $this->out->writeLinef('===> Time taken: %.3f seconds', $result->elapsed());
 }
 /**
  * Called when a test run finishes.
  *
  * @param  unittest.TestSuite $suite
  * @param  unittest.TestResult $result
  * @param  unittest.StopTests $stop
  */
 public function testRunFinished(\unittest\TestSuite $suite, \unittest\TestResult $result, \unittest\StopTests $stopped = null)
 {
     $failed = $result->failureCount();
     if ($stopped) {
         $this->out->writeLine('|');
         $indicator = ($this->colored ? "■ " : 'STOP ') . $stopped->getMessage();
     } else {
         if ($failed) {
             $this->out->writeLine(']');
             $indicator = $this->colored ? "×" : 'FAIL';
         } else {
             $this->out->writeLine(']');
             $indicator = $this->colored ? "♥" : 'OK';
         }
     }
     // Show failed test details
     if ($failed) {
         $this->out->writeLine();
         foreach ($result->failed as $failure) {
             $this->out->writeLine('F ', $failure);
         }
     }
     $this->out->writeLinef("\n%s: %d/%d run (%d skipped), %d succeeded, %d failed%s", $indicator, $result->runCount(), $result->count(), $result->skipCount(), $result->successCount(), $result->failureCount(), $this->colored ? "" : '');
     $this->out->writeLinef('Memory used: %.2f kB (%.2f kB peak)', Runtime::getInstance()->memoryUsage() / 1024, Runtime::getInstance()->peakMemoryUsage() / 1024);
     $this->out->writeLinef('Time taken: %.3f seconds', $result->elapsed());
 }