You are here

public function OutputFormatterTest::testBundledStyles 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::testBundledStyles()

File

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

Class

OutputFormatterTest

Namespace

Symfony\Component\Console\Tests\Formatter

Code

public function testBundledStyles() {
  $formatter = new OutputFormatter(true);
  $this
    ->assertTrue($formatter
    ->hasStyle('error'));
  $this
    ->assertTrue($formatter
    ->hasStyle('info'));
  $this
    ->assertTrue($formatter
    ->hasStyle('comment'));
  $this
    ->assertTrue($formatter
    ->hasStyle('question'));
  $this
    ->assertEquals("\33[37;41msome error\33[39;49m", $formatter
    ->format('<error>some error</error>'));
  $this
    ->assertEquals("\33[32msome info\33[39m", $formatter
    ->format('<info>some info</info>'));
  $this
    ->assertEquals("\33[33msome comment\33[39m", $formatter
    ->format('<comment>some comment</comment>'));
  $this
    ->assertEquals("\33[30;46msome question\33[39;49m", $formatter
    ->format('<question>some question</question>'));
}