コード例 #1
0
 /**
  * Output a test failure.
  *
  * @param int $errorNumber
  * @param TestInterface $test
  * @param $exception
  */
 protected function outputError($errorNumber, TestInterface $test, \Exception $exception)
 {
     $this->output->writeln(sprintf("  %d)%s:", $errorNumber, $test->getTitle()));
     $message = sprintf("     %s", str_replace(PHP_EOL, PHP_EOL . "     ", $exception->getMessage()));
     $this->output->writeln($this->color('error', $message));
     $trace = $exception instanceof PeridotException ? $exception->getTraceString() : $exception->getTraceAsString();
     $trace = preg_replace('/^#/m', "      #", $trace);
     $this->output->writeln($this->color('muted', $trace));
 }
 /**
  * Handle the test.start event.
  */
 public function onTestStart(TestInterface $test)
 {
     $this->coverage->start($test->getTitle());
 }
コード例 #3
0
ファイル: BasicReporter.php プロジェクト: lionar/testing
 /**
  * Output a test failure.
  *
  * @param int $errorNumber
  * @param TestInterface $test
  * @param $exception - an exception like interface with ->getMessage(), ->getTraceAsString()
  */
 protected function outputError($errorNumber, TestInterface $test, $exception)
 {
     $this->output->writeln(sprintf("  %d)%s:", $errorNumber, $test->getTitle()));
     $message = sprintf("     %s", str_replace(PHP_EOL, PHP_EOL . "     ", $exception->getMessage()));
     $this->output->writeln($this->color('error', $message));
 }