You are here

public function ProcessBuilderTest::testShouldEscapeArgumentsAndPrefix 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::testShouldEscapeArgumentsAndPrefix()

File

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

Class

ProcessBuilderTest

Namespace

Symfony\Component\Process\Tests

Code

public function testShouldEscapeArgumentsAndPrefix() {
  $pb = new ProcessBuilder(array(
    'arg',
  ));
  $pb
    ->setPrefix('%prefix%');
  $proc = $pb
    ->getProcess();
  if ('\\' === DIRECTORY_SEPARATOR) {
    $this
      ->assertSame('^%"prefix"^% "arg"', $proc
      ->getCommandLine());
  }
  else {
    $this
      ->assertSame("'%prefix%' 'arg'", $proc
      ->getCommandLine());
  }
}