public function ProcessBuilderTest::testShouldEscapeArguments

File

drupal/core/vendor/symfony/process/Symfony/Component/Process/Tests/ProcessBuilderTest.php, line 127

Class

ProcessBuilderTest

Namespace

Symfony\Component\Process\Tests

Code

public function testShouldEscapeArguments() {
  $pb = new ProcessBuilder(array(
    '%path%',
    'foo " bar',
  ));
  $proc = $pb
    ->getProcess();
  if (defined('PHP_WINDOWS_VERSION_BUILD')) {
    $this
      ->assertSame('^%"path"^% "foo "\\"" bar"', $proc
      ->getCommandLine());
  }
  else {
    $this
      ->assertSame("'%path%' 'foo \" bar'", $proc
      ->getCommandLine());
  }
}