You are here

public function OutputFormatterStyleTest::testBackground in Zircon Profile 8

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

File

vendor/symfony/console/Tests/Formatter/OutputFormatterStyleTest.php, line 47

Class

OutputFormatterStyleTest

Namespace

Symfony\Component\Console\Tests\Formatter

Code

public function testBackground() {
  $style = new OutputFormatterStyle();
  $style
    ->setBackground('black');
  $this
    ->assertEquals("\33[40mfoo\33[49m", $style
    ->apply('foo'));
  $style
    ->setBackground('yellow');
  $this
    ->assertEquals("\33[43mfoo\33[49m", $style
    ->apply('foo'));
  $style
    ->setBackground('default');
  $this
    ->assertEquals("\33[49mfoo\33[49m", $style
    ->apply('foo'));
  $this
    ->setExpectedException('InvalidArgumentException');
  $style
    ->setBackground('undefined-color');
}