You are here

public function ProcessBuilderTest::testPrefixIsPrependedToAllGeneratedProcess in Zircon Profile 8

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

File

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

Class

ProcessBuilderTest

Namespace

Symfony\Component\Process\Tests

Code

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