Exemple #1
0
 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 = "{$output}";
                     break;
                 case self::ERROR:
                     $output .= ' (ERROR - ' . count($this->exceptions) . ')';
                     $output = "{$output}";
                     break;
                 case self::INCOMPLETE:
                     $output .= ' (INCOMPLETE)';
                     $output = "{$output}";
                     break;
                 case self::SKIPPED:
                     $output .= ' (SKIPPED)';
                     $output = "{$output}";
                     break;
             }
         } else {
             $output = "" . $output . "";
         }
         $this->write($output . PHP_EOL);
     }
 }