You are here

public function OutputFormatterTest::testLGCharEscaping in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/console/Tests/Formatter/OutputFormatterTest.php \Symfony\Component\Console\Tests\Formatter\OutputFormatterTest::testLGCharEscaping()

File

vendor/symfony/console/Tests/Formatter/OutputFormatterTest.php, line 25

Class

OutputFormatterTest

Namespace

Symfony\Component\Console\Tests\Formatter

Code

public function testLGCharEscaping() {
  $formatter = new OutputFormatter(true);
  $this
    ->assertEquals('foo<bar', $formatter
    ->format('foo\\<bar'));
  $this
    ->assertEquals('<info>some info</info>', $formatter
    ->format('\\<info>some info\\</info>'));
  $this
    ->assertEquals('\\<info>some info\\</info>', OutputFormatter::escape('<info>some info</info>'));
  $this
    ->assertEquals("\33[33mSymfony\\Component\\Console does work very well!\33[39m", $formatter
    ->format('<comment>Symfony\\Component\\Console does work very well!</comment>'));
}