Exemple #1
0
 public function execute(InputInterface $input, OutputInterface $output)
 {
     $output->writeln(Phprtest::versionString() . PHP_EOL . str_repeat('-', strlen(Phprtest::versionString()) + 5) . PHP_EOL);
     $tests = $this->loadTests($input->getArgument('suite'));
     if ($input->getOption('etalon-test')) {
         array_unshift($tests, 'Phprtest\\EtalonTest');
     }
     $phprtest = new Phprtest();
     foreach ($tests as $test) {
         $phprtest->run($test);
     }
     if ($input->getOption('no-checks')) {
         $output->writeln("<fg=white;bg=yellow>  All assertions are skipped (--no-checks flag)  </fg=white;bg=yellow>\n");
     } else {
         $phprtest->checkLimits();
     }
     $output->write($phprtest->processResults());
     if ($phprtest->isFailure()) {
         $output->writeln("\n<fg=white;bg=red>\n TEST FAILED \n</fg=white;bg=red>");
         exit(1);
     }
 }