Example #1
0
 /**
  * @param EngineEvent $engineEvent
  */
 public function onEngineEnd(EngineEvent $engineEvent)
 {
     if (!$engineEvent->has('start') || !$engineEvent->has('end') || !$engineEvent->has('process_completed')) {
         throw new \BadMethodCallException('missing argument/s');
     }
     $outputInterface = $engineEvent->getOutputInterface();
     $elapsedTime = $engineEvent->get('start')->diff($engineEvent->get('end'));
     $completedProcesses = $engineEvent->get('process_completed');
     $outputInterface->writeln('');
     $outputInterface->writeln('');
     $outputInterface->writeln($elapsedTime->format('Execution time -- %H:%I:%S '));
     $outputInterface->writeln('');
     $outputInterface->write('Executed: ');
     $outputInterface->write(count($completedProcesses) . ' test classes, ');
     $testsCount = 0;
     foreach ($completedProcesses as $process) {
         $this->analyzeProcess($process);
         $testsCount += count($process->getTestResults());
     }
     $outputInterface->writeln($testsCount . ' tests');
     foreach ($this->outputContainers as $outputContainer) {
         $this->printFailuresOutput($outputInterface, $outputContainer);
     }
     foreach ($this->outputContainers as $outputContainer) {
         $this->printFileRecap($outputInterface, $outputContainer);
     }
     $outputInterface->writeln('');
 }
Example #2
0
 /**
  * @param EngineEvent $engineEvent
  */
 public function onEngineEnd(EngineEvent $engineEvent)
 {
     $output = $engineEvent->getOutputInterface();
     foreach ($this->logParser->getParsersForPrinting() as $parser) {
         if ($parser instanceof TestResultContainer) {
             $this->printFailuresOutput($parser, $output);
         }
     }
 }
Example #3
0
 /**
  * @param EngineEvent $engineEvent
  */
 public function onEngineEnd(EngineEvent $engineEvent)
 {
     $output = $engineEvent->getOutputInterface();
     foreach ($this->logParser->getParsersForPrinting() as $parser) {
         if ($parser instanceof TestFilenameBearerInterface) {
             $this->printFileRecap($parser, $output);
         }
     }
 }
Example #4
0
 /**
  * @param EngineEvent $engineEvent
  */
 public function onEngineStart(EngineEvent $engineEvent)
 {
     $formatter = $engineEvent->getOutputInterface()->getFormatter();
     if ($formatter) {
         $formatter->setStyle('ok', $this->createNewStyle('green'));
         $formatter->setStyle('skip', $this->createNewStyle('yellow'));
         $formatter->setStyle('warning', $this->createNewStyle('yellow'));
         $formatter->setStyle('incomplete', $this->createNewStyle('blue'));
         $formatter->setStyle('fail', $this->createNewStyle('red'));
         $formatter->setStyle('error', $this->createNewStyle('red'));
         $formatter->setStyle('abnormal', $this->createNewStyle('magenta'));
     }
 }
Example #5
0
 /**
  * @param EngineEvent $engineEvent
  */
 private function printTestCounters(EngineEvent $engineEvent)
 {
     $output = $engineEvent->getOutputInterface();
     $completedProcesses = $engineEvent->get('process_completed');
     $testsCount = 0;
     /** @var AbstractParaunitProcess $process */
     foreach ($this->logParser->getParsersForPrinting() as $parser) {
         if ($parser instanceof TestResultContainer) {
             $testsCount += $parser->countTestResults();
         }
     }
     $output->writeln('');
     $output->writeln(sprintf('Executed: %d test classes, %d tests', count($completedProcesses), $testsCount));
     $output->writeln('');
 }
Example #6
0
 /**
  * @param EngineEvent $engineEvent
  */
 public function onEngineStart(EngineEvent $engineEvent)
 {
     $outputInterface = $engineEvent->getOutputInterface();
     if ($outputInterface->getFormatter()) {
         $style = new OutputFormatterStyle('green', null, array('bold', 'blink'));
         $outputInterface->getFormatter()->setStyle('ok', $style);
         $style = new OutputFormatterStyle('yellow', null, array('bold', 'blink'));
         $outputInterface->getFormatter()->setStyle('skipped', $style);
         $style = new OutputFormatterStyle('blue', null, array('bold', 'blink'));
         $outputInterface->getFormatter()->setStyle('incomplete', $style);
         $style = new OutputFormatterStyle('red', null, array('bold', 'blink'));
         $outputInterface->getFormatter()->setStyle('fail', $style);
         $style = new OutputFormatterStyle('red', null, array('bold', 'blink'));
         $outputInterface->getFormatter()->setStyle('error', $style);
     }
 }
Example #7
0
 public function onEngineStart(EngineEvent $engineEvent)
 {
     $outputInterface = $engineEvent->getOutputInterface();
     $outputInterface->writeln('                                                   B>                           ');
     $outputInterface->writeln('                                                   B "Bp                        ');
     $outputInterface->writeln('.pp..                                              B    9p                      ');
     $outputInterface->writeln(' "9BBBBBBpp.                                       B      9p                    ');
     $outputInterface->writeln('    " ""9BBBBBBpp                          .<eeP"B B      .B b                  ');
     $outputInterface->writeln('           "SANDROBpp              .     B B     B B      )B B                  ');
     $outputInterface->writeln('              "BFRABBBB>  .<pe6P\\B B     B B     B B      $  B     .e           ');
     $outputInterface->writeln('                 5NICOBBB B     ·B B     B B     B Bqp.  :B  B     $ 4BBpp      ');
     $outputInterface->writeln('                   BMIKIB B        B     B B     B B   "^Bp  B    ) |BBB"\\BBpp. ');
     $outputInterface->writeln('                 .BALEBBB """9q.   B"""""B B"""""B B      1p B""""9p BBBBbBBBBBBB');
     $outputInterface->writeln('               <BLUCABBBB B    "B  B     B B     B B       B B     9 9BBB< ^P"  ');
     $outputInterface->writeln('            .6BSERGIOBBBB B666666B B     B B     B B       9 P      7 9BBBBP    ');
     $outputInterface->writeln('');
     $outputInterface->writeln('PARAUNIT v' . Paraunit::VERSION . ' - by Francesco Panina, Alessandro Lai & Shark Dev Team @ Facile.it');
 }