/**
  * @param InputDefinition $inputDefinition
  * @param InputInterface  $input
  * @param string          $expectedCommandLine
  * @param array           $skipOptions
  *
  * @see          ScenarioProcessFactory::init
  * @see          ScenarioProcessFactory::make
  *
  * @dataProvider providerMake
  */
 public function testMake(InputDefinition $inputDefinition, InputInterface $input, $expectedCommandLine = '', array $skipOptions = [])
 {
     $scenarioProcessFactory = new ScenarioProcessFactory('bin/behat');
     $scenarioProcessFactory->addSkipOptions($skipOptions);
     $scenarioProcessFactory->init($inputDefinition, $input);
     $scenarioInfo = new ScenarioInfo('file', 1);
     $process = $scenarioProcessFactory->make($scenarioInfo);
     $this->assertEquals(trim(sprintf('%s bin/behat \'file:1\' %s', PHP_BINARY, $expectedCommandLine)), $process->getCommandLine());
 }
 /**
  * @param ScenarioInfo[] $scenarios
  *
  * @return int
  */
 protected function runScenarios(array $scenarios)
 {
     $result = 0;
     /** @var ScenarioProcess[] $processes */
     $processes = array_map(function (ScenarioInfo $scenarioInfo) {
         return $this->scenarioProcessFactory->make($scenarioInfo);
     }, $scenarios);
     $this->parallelProcessRunner->reset()->add($processes)->run();
     foreach ($processes as $process) {
         $result = max($result, $process->getExitCode());
     }
     return $result;
 }