Ejemplo n.º 1
0
 /**
  * Find and run the tests
  *
  * @param array $arguments
  * @return bool
  */
 public function run(array $arguments) : bool
 {
     $exception = null;
     try {
         $this->prepareConfigurationProvider($arguments);
         $this->prepareCustomBootstrapAndAutoloading($this->configurationProvider->get('bootstrap'));
         $this->printer->setVerbose($this->configurationProvider->get('verbose'));
         $this->exceptionPrinter->setVerbose($this->configurationProvider->get('verbose'));
         switch ($this->configurationProvider->get('command')) {
             case 'list':
                 $commandClass = ListCommand::class;
                 break;
             case 'run':
             default:
                 $commandClass = RunCommand::class;
                 break;
         }
         /** @var CommandInterface $command */
         $command = $this->objectManager->get($commandClass, $this->configurationProvider, $this->objectManager, $this->classLoader, $this->printer, $this->exceptionPrinter);
         $result = $command->run();
         $this->printFooter();
         return $result;
     } catch (ConfigurationException $exception) {
     } catch (FileNotExistsException $exception) {
     }
     $this->error($exception->getMessage());
     return false;
 }