You are here

public function StringInputTest::testToString in Zircon Profile 8

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

File

vendor/symfony/console/Tests/Input/StringInputTest.php, line 88

Class

StringInputTest

Namespace

Symfony\Component\Console\Tests\Input

Code

public function testToString() {
  $input = new StringInput('-f foo');
  $this
    ->assertEquals('-f foo', (string) $input);
  $input = new StringInput('-f --bar=foo "a b c d"');
  $this
    ->assertEquals('-f --bar=foo ' . escapeshellarg('a b c d'), (string) $input);
  $input = new StringInput('-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);
}