66use PackageFactory \ColorHelper \Domain \ValueObject \HslaColor ;
77use PackageFactory \ColorHelper \Domain \ValueObject \RgbaColor ;
88use PackageFactory \ColorHelper \Eel \ColorBuilder ;
9- use PackageFactory \ColorHelper \Eel \ColorHelper ;
109
1110class ColorBuilderTest extends AbstractColorTest
1211{
@@ -17,51 +16,51 @@ public function setUp(): void
1716 $ this ->builder = new ColorBuilder ();
1817 }
1918
20- public function colorsCanBeCreatedViaRgbFactoryMethodDataProvider ():array
19+ public function colorsCanBeCreatedViaRgbFactoryMethodDataProvider (): array
2120 {
2221 return [
23- [100 ,0 , 255 ,null , new RgbaColor (100 , 0 , 255 )],
24- [0 ,0 , 0 , null , new RgbaColor (0 , 0 , 0 )],
25- [100 ,0 , 255 ,128 , new RgbaColor (100 , 0 , 255 , 128 )]
22+ [100 , 0 , 255 , null , new RgbaColor (100 , 0 , 255 )],
23+ [0 , 0 , 0 , null , new RgbaColor (0 , 0 , 0 )],
24+ [100 , 0 , 255 , 128 , new RgbaColor (100 , 0 , 255 , 128 )],
2625 ];
2726 }
2827
2928 /**
3029 * @test
3130 * @dataProvider colorsCanBeCreatedViaRgbFactoryMethodDataProvider
3231 */
33- public function colorsCanBeCreatedViaRgbFactoryMethod (float $ red , float $ green , float $ blue , float $ alpha = null , ColorInterface $ expectation )
32+ public function colorsCanBeCreatedViaRgbFactoryMethod (float $ red , float $ green , float $ blue , float $ alpha = null , ColorInterface $ expectation )
3433 {
3534 $ color = $ this ->builder ->rgb ($ red , $ green , $ blue , $ alpha ?? 255 )->getColor ();
3635 $ this ->assertSameColor ($ expectation , $ color );
3736 }
3837
39- public function colorsCanBeCreatedViaHslFactoryMethodDataProvider ():array
38+ public function colorsCanBeCreatedViaHslFactoryMethodDataProvider (): array
4039 {
4140 return [
42- [100 ,25 ,75 ,1 , new HslaColor (100 ,25 ,75 ,1 )],
43- [100 ,25 ,100 ,1 , new HslaColor (100 ,25 ,100 ,1 )],
44- [100 ,25 ,0 , 1 , new HslaColor (0 ,0 , 0 , 1 )]
41+ [100 , 25 , 75 , 1 , new HslaColor (100 , 25 , 75 , 1 )],
42+ [100 , 25 , 100 , 1 , new HslaColor (100 , 25 , 100 , 1 )],
43+ [100 , 25 , 0 , 1 , new HslaColor (0 , 0 , 0 , 1 )],
4544 ];
4645 }
4746
4847 /**
4948 * @test
5049 * @dataProvider colorsCanBeCreatedViaHslFactoryMethodDataProvider
5150 */
52- public function colorsCanBeCreatedViaHslFactoryMethod (float $ hue , float $ saturation , float $ lightness , float $ alpha , ColorInterface $ expectation )
51+ public function colorsCanBeCreatedViaHslFactoryMethod (float $ hue , float $ saturation , float $ lightness , float $ alpha , ColorInterface $ expectation )
5352 {
5453 $ color = $ this ->builder ->hsl ($ hue , $ saturation , $ lightness , $ alpha ?? 1 )->getColor ();
5554 $ this ->assertSameColor ($ expectation , $ color );
5655 }
5756
58- public function colorsCanBeCreatedViaHexFactoryMethodDataProvider ():array
57+ public function colorsCanBeCreatedViaHexFactoryMethodDataProvider (): array
5958 {
6059 return [
61- ['#ae8 ' ,'#aaee88 ' ],
62- ['#6400ff ' ,'#6400ff ' ],
63- ['#FFAAEEDD ' ,'#ffaaeedd ' ],
64- ['#ffeeaa88 ' ,'#ffeeaa88 ' ]
60+ ['#ae8 ' , '#aaee88 ' ],
61+ ['#6400ff ' , '#6400ff ' ],
62+ ['#FFAAEEDD ' , '#ffaaeedd ' ],
63+ ['#ffeeaa88 ' , '#ffeeaa88 ' ],
6564 ];
6665 }
6766
@@ -76,17 +75,17 @@ public function colorsCanBeCreatedViaHexFactoryMethod($hexString, $hex)
7675 $ this ->assertSameColor ($ expectation , $ color );
7776 }
7877
79- public function colorsCanBeCreatedViaCssFactoryMethodDataProvider ():array
78+ public function colorsCanBeCreatedViaCssFactoryMethodDataProvider (): array
8079 {
8180 return [
82- ['#ae8 ' ,'#aaee88 ' ],
83- ['#6400ff ' ,'#6400ff ' ],
84- ['#FFAAEEDD ' ,'#ffaaeedd ' ],
85- ['#ffeeaa88 ' ,'#ffeeaa88 ' ],
86- ['rgb(128,128,128) ' ,'#808080 ' ],
87- ['rgba(128,128,128,255) ' ,'#808080 ' ],
88- ['hsl(66,100%,75%) ' ,'#f2ff80 ' ],
89- ['hsl(66,100%,75%,1) ' ,'#f2ff80 ' ]
81+ ['#ae8 ' , '#aaee88 ' ],
82+ ['#6400ff ' , '#6400ff ' ],
83+ ['#FFAAEEDD ' , '#ffaaeedd ' ],
84+ ['#ffeeaa88 ' , '#ffeeaa88 ' ],
85+ ['rgb(128,128,128) ' , '#808080 ' ],
86+ ['rgba(128,128,128,255) ' , '#808080 ' ],
87+ ['hsl(66,100%,75%) ' , '#f2ff80 ' ],
88+ ['hsl(66,100%,75%,1) ' , '#f2ff80 ' ],
9089 ];
9190 }
9291
0 commit comments