Наследование: extends BaseRunner
Пример #1
0
 /**
  * Executes the PHPUnit Runner. Will Display help if no config and no path
  * supplied
  *
  * @param InputInterface $input
  * @param OutputInterface $output
  * @return int|mixed
  */
 public function execute(InputInterface $input, OutputInterface $output)
 {
     if (!$this->hasConfig($input) && !$this->hasPath($input)) {
         $this->displayHelp($input, $output);
     }
     if ($input->getOption('runner') === 'WrapperRunner') {
         $runner = new WrapperRunner($this->getRunnerOptions($input));
     } else {
         $runner = new Runner($this->getRunnerOptions($input));
     }
     $runner->run();
     return $runner->getExitCode();
 }
Пример #2
0
 public function testLogJUnitCreatesXmlFile()
 {
     $outputPath = FIXTURES . DS . 'logs' . DS . 'test-output.xml';
     $this->options['log-junit'] = $outputPath;
     $runner = new Runner($this->options);
     ob_start();
     $runner->run();
     ob_end_clean();
     $this->assertTrue(file_exists($outputPath));
     $this->assertJunitXmlIsCorrect($outputPath);
     if (file_exists($outputPath)) {
         unlink($outputPath);
     }
 }
Пример #3
0
 /**
  * Executes the PHPUnit Runner. Will Display help if no config and no path
  * supplied
  *
  * @param InputInterface $input
  * @param OutputInterface $output
  * @return int|mixed
  */
 public function execute(InputInterface $input, OutputInterface $output)
 {
     if (!$this->hasConfig($input) && !$this->hasPath($input)) {
         $this->displayHelp($input, $output);
     }
     if ($input->getOption('runner') === 'WrapperRunner') {
         $runner = new WrapperRunner($this->getRunnerOptions($input));
     } else {
         if ($input->getOption('runner') !== '') {
             // because we want to have to bootstrap script inherited before check/initialization
             $runnerOption = $this->getRunnerOptions($input);
             $runnerClass = $input->getOption('runner');
             if (class_exists($runnerClass)) {
                 $runner = new $runnerClass($runnerOption);
             }
         }
     }
     if (!isset($runner)) {
         $runner = new Runner($this->getRunnerOptions($input));
     }
     $runner->run();
     return $runner->getExitCode();
 }