/**
  * @param string $optionName
  * @param string $optionValue
  */
 public function testCommon($optionName = 'option', $optionValue = 'test')
 {
     $process = new ScenarioProcess(new ScenarioInfo('file', 0), 'cmd');
     $process->setProcessOption(new ProcessOptionScalar($optionName, $optionValue));
     $this->assertEquals(sprintf('cmd --%s %s', $optionName, escapeshellarg($optionValue)), $process->getCommandLine());
     $process->setProcessOption(new ProcessOptionScalar($optionName, $optionValue . $optionValue));
     $this->assertEquals(sprintf('cmd --%s %s', $optionName, escapeshellarg($optionValue . $optionValue)), $process->getCommandLine());
 }
 /**
  * @param ScenarioInfo $scenarioInfo
  *
  * @return Process
  */
 public function make(ScenarioInfo $scenarioInfo)
 {
     $fileLine = (string) $scenarioInfo;
     $options = $this->optionCollection->toArray();
     $outOption = $this->optionCollection->get('out');
     if ($outOption instanceof ProcessOptionOut) {
         $outOption->setOutSuffix(md5($fileLine));
         $options['out'] = clone $outOption;
     }
     $commandLine = sprintf('%s %s %s', PHP_BINARY, $this->behatBinaryPath, escapeshellarg($fileLine));
     $process = new ScenarioProcess($scenarioInfo, $commandLine);
     foreach ($options as $option) {
         $process->setProcessOption($option);
     }
     return $process;
 }