You are here

class ProcessUtilsTest in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/process/Tests/ProcessUtilsTest.php \Symfony\Component\Process\Tests\ProcessUtilsTest

Hierarchy

  • class \Symfony\Component\Process\Tests\ProcessUtilsTest extends \Symfony\Component\Process\Tests\PHPUnit_Framework_TestCase

Expanded class hierarchy of ProcessUtilsTest

File

vendor/symfony/process/Tests/ProcessUtilsTest.php, line 16

Namespace

Symfony\Component\Process\Tests
View source
class ProcessUtilsTest extends \PHPUnit_Framework_TestCase {

  /**
   * @dataProvider dataArguments
   */
  public function testEscapeArgument($result, $argument) {
    $this
      ->assertSame($result, ProcessUtils::escapeArgument($argument));
  }
  public function dataArguments() {
    if ('\\' === DIRECTORY_SEPARATOR) {
      return array(
        array(
          '"\\"php\\" \\"-v\\""',
          '"php" "-v"',
        ),
        array(
          '"foo bar"',
          'foo bar',
        ),
        array(
          '^%"path"^%',
          '%path%',
        ),
        array(
          '"<|>\\" \\"\'f"',
          '<|>" "\'f',
        ),
        array(
          '""',
          '',
        ),
        array(
          '"with\\trailingbs\\\\"',
          'with\\trailingbs\\',
        ),
      );
    }
    return array(
      array(
        "'\"php\" \"-v\"'",
        '"php" "-v"',
      ),
      array(
        "'foo bar'",
        'foo bar',
      ),
      array(
        "'%path%'",
        '%path%',
      ),
      array(
        "'<|>\" \"'\\''f'",
        '<|>" "\'f',
      ),
      array(
        "''",
        '',
      ),
      array(
        "'with\\trailingbs\\'",
        'with\\trailingbs\\',
      ),
    );
  }

}

Members