You are here

protected function PHPUnit_TextUI_ResultPrinter::printFooter in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/phpunit/phpunit/src/TextUI/ResultPrinter.php \PHPUnit_TextUI_ResultPrinter::printFooter()

Parameters

PHPUnit_Framework_TestResult $result:

1 call to PHPUnit_TextUI_ResultPrinter::printFooter()
PHPUnit_TextUI_ResultPrinter::printResult in vendor/phpunit/phpunit/src/TextUI/ResultPrinter.php

File

vendor/phpunit/phpunit/src/TextUI/ResultPrinter.php, line 325

Class

PHPUnit_TextUI_ResultPrinter
Prints the result of a TextUI TestRunner run.

Code

protected function printFooter(PHPUnit_Framework_TestResult $result) {
  if (count($result) === 0) {
    $this
      ->writeWithColor('fg-black, bg-yellow', 'No tests executed!');
  }
  elseif ($result
    ->wasSuccessful() && $result
    ->allHarmless() && $result
    ->allCompletelyImplemented() && $result
    ->noneSkipped()) {
    $this
      ->writeWithColor('fg-black, bg-green', sprintf('OK (%d test%s, %d assertion%s)', count($result), count($result) == 1 ? '' : 's', $this->numAssertions, $this->numAssertions == 1 ? '' : 's'));
  }
  else {
    if ($result
      ->wasSuccessful()) {
      $color = 'fg-black, bg-yellow';
      if ($this->verbose) {
        $this
          ->write("\n");
      }
      $this
        ->writeWithColor($color, 'OK, but incomplete, skipped, or risky tests!');
    }
    else {
      $color = 'fg-white, bg-red';
      $this
        ->write("\n");
      $this
        ->writeWithColor($color, 'FAILURES!');
    }
    $this
      ->writeCountString(count($result), 'Tests', $color, true);
    $this
      ->writeCountString($this->numAssertions, 'Assertions', $color, true);
    $this
      ->writeCountString($result
      ->errorCount(), 'Errors', $color);
    $this
      ->writeCountString($result
      ->failureCount(), 'Failures', $color);
    $this
      ->writeCountString($result
      ->skippedCount(), 'Skipped', $color);
    $this
      ->writeCountString($result
      ->notImplementedCount(), 'Incomplete', $color);
    $this
      ->writeCountString($result
      ->riskyCount(), 'Risky', $color);
    $this
      ->writeWithColor($color, '.', true);
  }
}