Beispiel #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('');
 }
Beispiel #2
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('');
 }