Ejemplo n.º 1
0
 public function displayFatal(CurrentExampleTracker $currentExample, $error)
 {
     if (null !== $error && $currentExample->getCurrentExample() || is_null($currentExample->getCurrentExample()) && defined('HHVM_VERSION')) {
         ini_set('display_errors', "stderr");
         $failedOpen = $this->io->isDecorated() ? '<failed>' : '';
         $failedClosed = $this->io->isDecorated() ? '</failed>' : '';
         $failedCross = $this->io->isDecorated() ? '✘' : '';
         $this->io->writeln("{$failedOpen}{$failedCross} Fatal error happened while executing the following {$failedClosed}");
         $this->io->writeln("{$failedOpen}    {$currentExample->getCurrentExample()} {$failedClosed}");
         $this->io->writeln("{$failedOpen}    {$error['message']} in {$error['file']} on line {$error['line']} {$failedClosed}");
     }
 }
 function it_should_not_color_output_text_report_unless_specified(\PHP_CodeCoverage $coverage, \PHP_CodeCoverage_Report_Text $text, SuiteEvent $event, IO $io)
 {
     $reports = array('text' => $text);
     $this->beConstructedWith($coverage, $reports);
     $this->setOptions(array('format' => 'text'));
     $io->isVerbose()->willReturn(false);
     $io->isDecorated()->willReturn(false);
     $this->setIO($io);
     $text->process($coverage, false)->willReturn('report');
     $io->writeln('report')->shouldBeCalled();
     $this->afterSuite($event);
 }
Ejemplo n.º 3
0
 /**
  * @param IO    $io
  * @param array $progress
  * @param int   $total
  */
 private function updateProgressBar(IO $io, array $progress, $total)
 {
     if ($io->isDecorated()) {
         $progressBar = implode('', $progress);
         $pad = $this->getIO()->getBlockWidth() - strlen(strip_tags($progressBar));
         $io->writeTemp($progressBar . str_repeat(' ', $pad + 1) . $total);
     } else {
         $io->writeTemp('/' . implode('/', $progress) . '/  ' . $total . ' examples');
     }
 }