diff --git a/src/Symfony/Component/Console/Formatter/OutputFormatterStyle.php b/src/Symfony/Component/Console/Formatter/OutputFormatterStyle.php index 48e9850725f0..0438d4bc0393 100644 --- a/src/Symfony/Component/Console/Formatter/OutputFormatterStyle.php +++ b/src/Symfony/Component/Console/Formatter/OutputFormatterStyle.php @@ -29,6 +29,7 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface 'magenta' => 35, 'cyan' => 36, 'white' => 37, + 'default' => 39, ); private static $availableBackgroundColors = array( 'black' => 40, @@ -39,6 +40,7 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface 'magenta' => 45, 'cyan' => 46, 'white' => 47, + 'default' => 49, ); private static $availableOptions = array( 'bold' => 1, diff --git a/src/Symfony/Component/Console/Tests/Formatter/OutputFormatterStyleTest.php b/src/Symfony/Component/Console/Tests/Formatter/OutputFormatterStyleTest.php index 6890a9b839e8..d0ebb2751231 100644 --- a/src/Symfony/Component/Console/Tests/Formatter/OutputFormatterStyleTest.php +++ b/src/Symfony/Component/Console/Tests/Formatter/OutputFormatterStyleTest.php @@ -37,6 +37,9 @@ public function testForeground() $style->setForeground('blue'); $this->assertEquals("\033[34mfoo\033[0m", $style->apply('foo')); + $style->setForeground('default'); + $this->assertEquals("\033[39mfoo\033[39m", $style->apply('foo')); + $this->setExpectedException('InvalidArgumentException'); $style->setForeground('undefined-color'); } @@ -51,6 +54,9 @@ public function testBackground() $style->setBackground('yellow'); $this->assertEquals("\033[43mfoo\033[0m", $style->apply('foo')); + $style->setBackground('default'); + $this->assertEquals("\033[49mfoo\033[49m", $style->apply('foo')); + $this->setExpectedException('InvalidArgumentException'); $style->setBackground('undefined-color'); }