From 9c1188b4d8e554256b97729170f7a753a2b7af88 Mon Sep 17 00:00:00 2001 From: freshleafmedia <10062339+freshleafmedia@users.noreply.github.com> Date: Thu, 12 Nov 2020 17:28:51 +0000 Subject: [PATCH] Adds tests --- tests/EncoderTest.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/EncoderTest.php b/tests/EncoderTest.php index 834618c3..3a18e14a 100644 --- a/tests/EncoderTest.php +++ b/tests/EncoderTest.php @@ -61,6 +61,18 @@ class EncoderTest extends TestCase } } + /** + * @expectedException \Intervention\Image\Exception\NotSupportedException + */ + public function testProcessAvifGd() + { + $core = imagecreatefromjpeg(__DIR__.'/images/test.jpg'); + $encoder = new GdEncoder; + $image = Mockery::mock('\Intervention\Image\Image'); + $img = $encoder->process($image, 'avif', 90); + $this->assertInstanceOf('Intervention\Image\Image', $img); + } + /** * @expectedException \Intervention\Image\Exception\NotSupportedException */ @@ -180,6 +192,16 @@ class EncoderTest extends TestCase $img = $encoder->process($image, 'webp', 90); } + /** + * @expectedException \Intervention\Image\Exception\NotSupportedException + */ + public function testProcessAvifImagick() + { + $encoder = new ImagickEncoder; + $image = Mockery::mock('\Intervention\Image\Image'); + $img = $encoder->process($image, 'avif', 90); + } + public function testProcessTiffImagick() { $core = $this->getImagickMock('tiff');