@@ -25,7 +25,7 @@ public function setUp(): void
2525 /** @var File $image */
2626 $ files = File::get ()->exclude ('ClassName ' , Folder::class);
2727 foreach ($ files as $ image ) {
28- $ sourcePath = __DIR__ . '/images/ ' . $ image -> Name ;
28+ $ sourcePath = __DIR__ . '/images/pngTestImage.png ' ;
2929 $ image ->setFromLocalFile ($ sourcePath , $ image ->Filename );
3030 }
3131
@@ -50,28 +50,28 @@ public function tearDown(): void
5050 private function Images ()
5151 {
5252 $ pngLeftTop = $ this ->objFromFixture (Image::class, 'pngLeftTop ' );
53- $ pngLeftTop ->VerticalSliceTopLeftColor = '# ff0000 ' ;
54- $ pngLeftTop ->VerticalSliceBottomRightColor = '# 00ff00 ' ;
55- $ pngLeftTop ->HorizontalSliceTopLeftColor = '# ff0000 ' ;
56- $ pngLeftTop ->HorizontalSliceBottomRightColor = '# ffff00 ' ;
53+ $ pngLeftTop ->VerticalSliceTopLeftColor = 'ff0000 ' ;
54+ $ pngLeftTop ->VerticalSliceBottomRightColor = '00ff00 ' ;
55+ $ pngLeftTop ->HorizontalSliceTopLeftColor = 'ff0000 ' ;
56+ $ pngLeftTop ->HorizontalSliceBottomRightColor = 'ffff00 ' ;
5757
5858 $ pngRightTop = $ this ->objFromFixture (Image::class, 'pngRightTop ' );
59- $ pngRightTop ->VerticalSliceTopLeftColor = '# ffff00 ' ;
60- $ pngRightTop ->VerticalSliceBottomRightColor = '# 0000ff ' ;
61- $ pngRightTop ->HorizontalSliceTopLeftColor = '# ff0000 ' ;
62- $ pngRightTop ->HorizontalSliceBottomRightColor = '# ffff00 ' ;
59+ $ pngRightTop ->VerticalSliceTopLeftColor = 'ffff00 ' ;
60+ $ pngRightTop ->VerticalSliceBottomRightColor = '0000ff ' ;
61+ $ pngRightTop ->HorizontalSliceTopLeftColor = 'ff0000 ' ;
62+ $ pngRightTop ->HorizontalSliceBottomRightColor = 'ffff00 ' ;
6363
6464 $ pngRightBottom = $ this ->objFromFixture (Image::class, 'pngRightBottom ' );
65- $ pngRightBottom ->VerticalSliceTopLeftColor = '# ffff00 ' ;
66- $ pngRightBottom ->VerticalSliceBottomRightColor = '# 0000ff ' ;
67- $ pngRightBottom ->HorizontalSliceTopLeftColor = '# 00ff00 ' ;
68- $ pngRightBottom ->HorizontalSliceBottomRightColor = '# 0000ff ' ;
65+ $ pngRightBottom ->VerticalSliceTopLeftColor = 'ffff00 ' ;
66+ $ pngRightBottom ->VerticalSliceBottomRightColor = '0000ff ' ;
67+ $ pngRightBottom ->HorizontalSliceTopLeftColor = '00ff00 ' ;
68+ $ pngRightBottom ->HorizontalSliceBottomRightColor = '0000ff ' ;
6969
7070 $ pngLeftBottom = $ this ->objFromFixture (Image::class, 'pngLeftBottom ' );
71- $ pngLeftBottom ->VerticalSliceTopLeftColor = '# ff0000 ' ;
72- $ pngLeftBottom ->VerticalSliceBottomRightColor = '# 00ff00 ' ;
73- $ pngLeftBottom ->HorizontalSliceTopLeftColor = '# 00ff00 ' ;
74- $ pngLeftBottom ->HorizontalSliceBottomRightColor = '# 0000ff ' ;
71+ $ pngLeftBottom ->VerticalSliceTopLeftColor = 'ff0000 ' ;
72+ $ pngLeftBottom ->VerticalSliceBottomRightColor = '00ff00 ' ;
73+ $ pngLeftBottom ->HorizontalSliceTopLeftColor = '00ff00 ' ;
74+ $ pngLeftBottom ->HorizontalSliceBottomRightColor = '0000ff ' ;
7575
7676 return array ($ pngLeftTop , $ pngRightTop , $ pngRightBottom , $ pngLeftBottom );
7777 }
@@ -86,17 +86,17 @@ public function testFocusFill(): void
8686 $ croppedVert = $ img ->FocusFill (1 , 50 );
8787 $ this ->assertTrue ($ croppedVert ->isSize (1 , 50 ));
8888 $ im = $ croppedVert ->getImageBackend ()->getImageResource ();
89- $ leftTopColor = $ im ->pickColor (0 , 0 , ' hex ' );
90- $ bottomRightColor = $ im ->pickColor (0 , 49 , ' hex ' );
89+ $ leftTopColor = $ im ->pickColor (0 , 0 )-> toHex ( );
90+ $ bottomRightColor = $ im ->pickColor (0 , 49 )-> toHex ( );
9191 $ this ->assertEquals ($ img ->VerticalSliceTopLeftColor , $ leftTopColor );
9292 $ this ->assertEquals ($ img ->VerticalSliceBottomRightColor , $ bottomRightColor );
9393
9494 // Crop a horizontal slice
9595 $ croppedHorz = $ img ->FocusFill (50 , 1 );
9696 $ this ->assertTrue ($ croppedHorz ->isSize (50 , 1 ));
9797 $ im = $ croppedHorz ->getImageBackend ()->getImageResource ();
98- $ leftTopColor = $ im ->pickColor (0 , 0 , ' hex ' );
99- $ bottomRightColor = $ im ->pickColor (49 , 0 , ' hex ' );
98+ $ leftTopColor = $ im ->pickColor (0 , 0 )-> toHex ( );
99+ $ bottomRightColor = $ im ->pickColor (49 , 0 )-> toHex ( );
100100 $ this ->assertEquals ($ img ->HorizontalSliceTopLeftColor , $ leftTopColor );
101101 $ this ->assertEquals ($ img ->HorizontalSliceBottomRightColor , $ bottomRightColor );
102102 }
@@ -113,17 +113,17 @@ public function testFocusFillMax(): void
113113 $ croppedVert = $ img ->FocusFillMax (1 , 50 );
114114 $ this ->assertTrue ($ croppedVert ->isSize (1 , 50 ));
115115 $ im = $ croppedVert ->getImageBackend ()->getImageResource ();
116- $ leftTopColor = $ im ->pickColor (0 , 0 , ' hex ' );
117- $ bottomRightColor = $ im ->pickColor (0 , 49 , ' hex ' );
116+ $ leftTopColor = $ im ->pickColor (0 , 0 )-> toHex ( );
117+ $ bottomRightColor = $ im ->pickColor (0 , 49 )-> toHex ( );
118118 $ this ->assertEquals ($ img ->VerticalSliceTopLeftColor , $ leftTopColor );
119119 $ this ->assertEquals ($ img ->VerticalSliceBottomRightColor , $ bottomRightColor );
120120
121121 // Crop a horizontal slice
122122 $ croppedHorz = $ img ->FocusFillMax (50 , 1 );
123123 $ this ->assertTrue ($ croppedHorz ->isSize (50 , 1 ));
124124 $ im = $ croppedHorz ->getImageBackend ()->getImageResource ();
125- $ leftTopColor = $ im ->pickColor (0 , 0 , ' hex ' );
126- $ bottomRightColor = $ im ->pickColor (49 , 0 , ' hex ' );
125+ $ leftTopColor = $ im ->pickColor (0 , 0 )-> toHex ( );
126+ $ bottomRightColor = $ im ->pickColor (49 , 0 )-> toHex ( );
127127 $ this ->assertEquals ($ img ->HorizontalSliceTopLeftColor , $ leftTopColor );
128128 $ this ->assertEquals ($ img ->HorizontalSliceBottomRightColor , $ bottomRightColor );
129129
@@ -133,17 +133,17 @@ public function testFocusFillMax(): void
133133 $ croppedVert = $ img ->FocusFillMax (1 , 200 );
134134 $ this ->assertTrue ($ croppedVert ->isSize (1 , 100 ));
135135 $ im = $ croppedVert ->getImageBackend ()->getImageResource ();
136- $ leftTopColor = $ im ->pickColor (0 , 0 , ' hex ' );
137- $ bottomRightColor = $ im ->pickColor (0 , 99 , ' hex ' );
136+ $ leftTopColor = $ im ->pickColor (0 , 0 )-> toHex ( );
137+ $ bottomRightColor = $ im ->pickColor (0 , 99 )-> toHex ( );
138138 $ this ->assertEquals ($ img ->VerticalSliceTopLeftColor , $ leftTopColor );
139139 $ this ->assertEquals ($ img ->VerticalSliceBottomRightColor , $ bottomRightColor );
140140
141141 // Crop a horizontal slice
142142 $ croppedHorz = $ img ->FocusFillMax (200 , 1 );
143143 $ this ->assertTrue ($ croppedHorz ->isSize (100 , 1 ));
144144 $ im = $ croppedHorz ->getImageBackend ()->getImageResource ();
145- $ leftTopColor = $ im ->pickColor (0 , 0 , ' hex ' );
146- $ bottomRightColor = $ im ->pickColor (99 , 0 , ' hex ' );
145+ $ leftTopColor = $ im ->pickColor (0 , 0 )-> toHex ( );
146+ $ bottomRightColor = $ im ->pickColor (99 , 0 )-> toHex ( );
147147 $ this ->assertEquals ($ img ->HorizontalSliceTopLeftColor , $ leftTopColor );
148148 $ this ->assertEquals ($ img ->HorizontalSliceBottomRightColor , $ bottomRightColor );
149149 }
0 commit comments