@@ -215,6 +215,21 @@ public function resizeUpsizeToMoreVerticalAspect()
215215 $ this ->assertLessThan (0.1 , $ imageBottom ['luminosity ' ]);
216216 }
217217
218+ /**
219+ * @test
220+ * @covers ::resize
221+ * @covers ::resizeMulti
222+ */
223+ public function resizeWithUpsizeAndBestFit ()
224+ {
225+ $ source = new \Imagick ('pattern:gray0 ' );
226+ $ source ->scaleImage (85 , 45 );
227+ $ notBestFit = Image::resize ($ source , 300 , 300 , ['upsize ' => true , 'bestfit ' => false ]);
228+ $ this ->assertSame ('srgb(0,0,0) ' , $ notBestFit ->getImagePixelColor (299 , 100 )->getColorAsString ());
229+ $ bestFit = Image::resize ($ source , 300 , 300 , ['upsize ' => true , 'bestfit ' => true ]);
230+ $ this ->assertSame ('srgb(255,255,255) ' , $ bestFit ->getImagePixelColor (299 , 100 )->getColorAsString ());
231+ }
232+
218233 /**
219234 * @test
220235 * @covers ::resize
@@ -311,6 +326,18 @@ public function resizeNonBoolUpsize()
311326 Image::resize (new \Imagick (), 10 , 10 , ['upsize ' => 'not bool ' ]);
312327 }
313328
329+ /**
330+ * @test
331+ * @covers ::resize
332+ * @covers ::resizeMulti
333+ * @expectedException \InvalidArgumentException
334+ * @expectedExceptionMessage $options["bestfit"] was not a bool
335+ */
336+ public function resizeNonBoolBestFit ()
337+ {
338+ Image::resize (new \Imagick (), 10 , 10 , ['bestfit ' => 'not bool ' ]);
339+ }
340+
314341 /**
315342 * Verify images are rotated according to EXIF header
316343 * @test
0 commit comments