Exemplo n.º 1
1
 public function execute(InputInterface $input, OutputInterface $output)
 {
     $options = $input->getOptions();
     if ($input->getArgument('test')) {
         $options['steps'] = true;
     }
     $suite = $input->getArgument('suite');
     $test = $input->getArgument('test');
     $codecept = new \Codeception\Codecept((array) $options);
     $suites = $suite ? array($suite) : \Codeception\Configuration::suites();
     $output->writeln(\Codeception\Codecept::versionString() . "\nPowered by " . \PHPUnit_Runner_Version::getVersionString());
     if ($suite and $test) {
         $codecept->runSuite($suite, $test);
     }
     if (!$test) {
         foreach ($suites as $suite) {
             $codecept->runSuite($suite);
         }
     }
     $codecept->printResult();
     if (!$input->getOption('no-exit')) {
         if ($codecept->getResult()->failureCount() or $codecept->getResult()->errorCount()) {
             exit(1);
         }
     }
 }
Exemplo n.º 2
0
 protected function runSuites($suites, $skippedSuites = array())
 {
     $executed = 0;
     foreach ($suites as $suite) {
         if (in_array($suite, $skippedSuites)) {
             continue;
         }
         if (!in_array($suite, Configuration::suites())) {
             continue;
         }
         $this->codecept->run($suite);
         $executed++;
     }
     return $executed;
 }
Exemplo n.º 3
0
 public function execute(InputInterface $input, OutputInterface $output)
 {
     $output->writeln(\Codeception\Codecept::versionString() . "\nPowered by " . \PHPUnit_Runner_Version::getVersionString());
     $options = $input->getOptions();
     if ($options['group']) {
         $output->writeln(sprintf("[Groups] <info>%s</info> ", implode(', ', $options['group'])));
     }
     if ($input->getArgument('test') && strtolower(substr($input->getArgument('test'), -4)) === '.php') {
         $options['steps'] = true;
     }
     if ($input->getOption('debug')) {
         $output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE);
     }
     $suite = $input->getArgument('suite');
     $test = $input->getArgument('test');
     $codecept = new \Codeception\Codecept((array) $options);
     $config = \Codeception\Configuration::config();
     if (strpos($suite, $config['paths']['tests']) === 0) {
         $matches = $this->matchTestFromFilename($suite, $config['paths']['tests']);
         $suite = $matches[1];
         $test = $matches[2];
     }
     $suites = $suite ? array($suite) : \Codeception\Configuration::suites();
     if ($suite and $test) {
         $codecept->runSuite($suite, $test);
     }
     if (!$test) {
         foreach ($suites as $suite) {
             $codecept->runSuite($suite);
         }
     }
     $codecept->printResult();
     if (!$input->getOption('no-exit')) {
         if ($codecept->getResult()->failureCount() or $codecept->getResult()->errorCount()) {
             exit(1);
         }
     }
 }
Exemplo n.º 4
0
 public function testLatestVersion()
 {
     $this->markTestSkipped();
     $this->assertEquals(\Codeception\Codecept::VERSION, \Codeception\Codecept::checkLastVersion());
 }