예제 #1
0
 public function printResult(PrintResultEvent $e)
 {
     $printer = $e->getPrinter();
     if (!$this->settings['enabled']) {
         $printer->write("\nCodeCoverage is disabled in `codeception.yml` config\n");
         return;
     }
     if (!$this->options['quiet']) {
         $this->printConsole($printer);
     }
     $printer->write("Remote CodeCoverage reports are not printed to console\n");
     $this->printPHP();
     $printer->write("\n");
     if ($this->options['coverage-html']) {
         $this->printHtml();
         $printer->write("HTML report generated in {$this->options['coverage-html']}\n");
     }
     if ($this->options['coverage-xml']) {
         $this->printXml();
         $printer->write("XML report generated in {$this->options['coverage-xml']}\n");
     }
     if ($this->options['coverage-text']) {
         $this->printText();
         $printer->write("Text report generated in {$this->options['coverage-text']}\n");
     }
 }
 /**
  * @param PrintResultEvent $printResultEvent
  * @throws \Codeception\Exception\ModuleRequireException
  */
 public function resultPrintAfter(PrintResultEvent $printResultEvent)
 {
     if (count($this->failedIdentifiers) > 0) {
         $items = '';
         $itemTemplate = new \Text_Template($this->config['templateFolder'] . 'Item.html');
         foreach ($this->failedIdentifiers as $vars) {
             $itemTemplate->setVar($vars);
             $items .= $itemTemplate->render();
         }
         $pageTemplate = new \Text_Template($this->config['templateFolder'] . 'Page.html');
         $pageTemplate->setVar(array('items' => $items));
         $reportPath = $this->fileSystemUtil->getFailImageDirectory() . 'index.html';
         $pageTemplate->renderTo($reportPath);
         $printResultEvent->getPrinter()->write('Report has been created: ' . $reportPath . "\n");
     }
 }
예제 #3
0
 public function printResult(PrintResultEvent $e)
 {
     if ($this->options['steps']) {
         return;
     }
     $printer = $e->getPrinter();
     $this->printConsole($printer);
     $this->printPHP();
     $printer->write("\n");
     if ($this->options['coverage-html']) {
         $this->printHtml();
         $printer->write("HTML report generated in {$this->options['coverage-html']}\n");
     }
     if ($this->options['coverage-xml']) {
         $this->printXml();
         $printer->write("XML report generated in {$this->options['coverage-xml']}\n");
     }
     if ($this->options['coverage-text']) {
         $this->printText();
         $printer->write("Text report generated in {$this->options['coverage-text']}\n");
     }
 }