13
13
14
14
use PHPUnit \Framework \TestCase ;
15
15
use Symfony \Component \Console \Color ;
16
- use Symfony \Component \Console \Exception \InvalidArgumentException ;
17
16
18
17
class ColorTest extends TestCase
19
18
{
@@ -43,9 +42,6 @@ public function testTrueColors()
43
42
44
43
$ color = new Color ('#ffffff ' , '#000000 ' );
45
44
$ this ->assertSame ("\033[38;2;255;255;255;48;2;0;0;0m \033[39;49m " , $ color ->apply (' ' ));
46
-
47
- $ color = new Color ('rgb(255, 255, 255) ' , 'rgb(0, 0, 0) ' );
48
- $ this ->assertSame ("\033[38;2;255;255;255;48;2;0;0;0m \033[39;49m " , $ color ->apply (' ' ));
49
45
}
50
46
51
47
public function testDegradedTrueColors ()
@@ -63,32 +59,4 @@ public function testDegradedTrueColors()
63
59
putenv ('COLORTERM= ' .$ colorterm );
64
60
}
65
61
}
66
-
67
- /**
68
- * @dataProvider provideMalformedRgbStrings
69
- */
70
- public function testMalformedRgbString (string $ color , string $ exceptionMessage )
71
- {
72
- $ this ->expectException (InvalidArgumentException::class);
73
- $ this ->expectExceptionMessage ($ exceptionMessage );
74
-
75
- new Color ($ color );
76
- }
77
-
78
- public function provideMalformedRgbStrings (): \Generator
79
- {
80
- yield ['rgb() ' , 'Invalid RGB functional notation; should be of the form "rgb(r, g, b)", got "rgb()". ' ];
81
-
82
- yield ['rgb(0, 0) ' , 'Invalid RGB functional notation; should be of the form "rgb(r, g, b)", got "rgb(0, 0)". ' ];
83
-
84
- yield ['rgb(0, 0, 0, 0) ' , 'Invalid RGB functional notation; should be of the form "rgb(r, g, b)", got "rgb(0, 0, 0, 0)". ' ];
85
-
86
- yield ['rgb(-1, 0, 0) ' , 'Invalid RGB functional notation; should be of the form "rgb(r, g, b)", got "rgb(-1, 0, 0)". ' ];
87
-
88
- yield ['rgb(invalid, 0, 0) ' , 'Invalid RGB functional notation; should be of the form "rgb(r, g, b)", got "rgb(invalid, 0, 0)". ' ];
89
-
90
- yield ['rgb(256, 0, 0) ' , 'Invalid color component; value should be between 0 and 255, got 256. ' ];
91
-
92
- yield ['rgb(0, 0, 0 ' , 'Invalid RGB functional notation; should be of the form "rgb(r, g, b)", got "rgb(0, 0, 0". ' ];
93
- }
94
62
}
0 commit comments