We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent abcc0b8 commit a26dc09Copy full SHA for a26dc09
src/Symfony/Component/Console/Tests/ColorTest.php
@@ -40,4 +40,20 @@ public function testTrueColors()
40
$color = new Color('#ffffff', '#000000');
41
$this->assertSame("\033[38;2;255;255;255;48;2;0;0;0m \033[39;49m", $color->apply(' '));
42
}
43
+
44
+ public function testDegradedTrueColors()
45
+ {
46
+ $colorterm = getenv('COLORTERM');
47
+ putenv('COLORTERM=');
48
49
+ try {
50
+ $color = new Color('#f00', '#ff0');
51
+ $this->assertSame("\033[31;43m \033[39;49m", $color->apply(' '));
52
53
+ $color = new Color('#c0392b', '#f1c40f');
54
55
+ } finally {
56
+ putenv('COLORTERM='.$colorterm);
57
+ }
58
59
0 commit comments