You are here

public function ArgvInputTest::testToString in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/console/Tests/Input/ArgvInputTest.php \Symfony\Component\Console\Tests\Input\ArgvInputTest::testToString()

File

vendor/symfony/console/Tests/Input/ArgvInputTest.php, line 281

Class

ArgvInputTest

Namespace

Symfony\Component\Console\Tests\Input

Code

public function testToString() {
  $input = new ArgvInput(array(
    'cli.php',
    '-f',
    'foo',
  ));
  $this
    ->assertEquals('-f foo', (string) $input);
  $input = new ArgvInput(array(
    'cli.php',
    '-f',
    '--bar=foo',
    'a b c d',
    "A\nB'C",
  ));
  $this
    ->assertEquals('-f --bar=foo ' . escapeshellarg('a b c d') . ' ' . escapeshellarg("A\nB'C"), (string) $input);
}