You are here

public function ProcessBuilderTest::testArrayPrefixesArePrependedToAllGeneratedProcess in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/process/Tests/ProcessBuilderTest.php \Symfony\Component\Process\Tests\ProcessBuilderTest::testArrayPrefixesArePrependedToAllGeneratedProcess()

File

vendor/symfony/process/Tests/ProcessBuilderTest.php, line 119

Class

ProcessBuilderTest

Namespace

Symfony\Component\Process\Tests

Code

public function testArrayPrefixesArePrependedToAllGeneratedProcess() {
  $pb = new ProcessBuilder();
  $pb
    ->setPrefix(array(
    '/usr/bin/php',
    'composer.phar',
  ));
  $proc = $pb
    ->setArguments(array(
    '-v',
  ))
    ->getProcess();
  if ('\\' === DIRECTORY_SEPARATOR) {
    $this
      ->assertEquals('"/usr/bin/php" "composer.phar" "-v"', $proc
      ->getCommandLine());
  }
  else {
    $this
      ->assertEquals("'/usr/bin/php' 'composer.phar' '-v'", $proc
      ->getCommandLine());
  }
  $proc = $pb
    ->setArguments(array(
    '-i',
  ))
    ->getProcess();
  if ('\\' === DIRECTORY_SEPARATOR) {
    $this
      ->assertEquals('"/usr/bin/php" "composer.phar" "-i"', $proc
      ->getCommandLine());
  }
  else {
    $this
      ->assertEquals("'/usr/bin/php' 'composer.phar' '-i'", $proc
      ->getCommandLine());
  }
}