You are here

public function OutputFormatterStyleTest::testForeground in Zircon Profile 8.0

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

File

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

Class

OutputFormatterStyleTest

Namespace

Symfony\Component\Console\Tests\Formatter

Code

public function testForeground() {
  $style = new OutputFormatterStyle();
  $style
    ->setForeground('black');
  $this
    ->assertEquals("\33[30mfoo\33[39m", $style
    ->apply('foo'));
  $style
    ->setForeground('blue');
  $this
    ->assertEquals("\33[34mfoo\33[39m", $style
    ->apply('foo'));
  $style
    ->setForeground('default');
  $this
    ->assertEquals("\33[39mfoo\33[39m", $style
    ->apply('foo'));
  $this
    ->setExpectedException('InvalidArgumentException');
  $style
    ->setForeground('undefined-color');
}