1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-29 16:50:07 +02:00

Add GD AVIF test

This commit is contained in:
Gijsdev
2021-09-16 00:16:05 +02:00
parent 9a823065a1
commit a823bdc7c4

View File

@@ -75,17 +75,18 @@ class EncoderTest extends TestCase
} }
} }
/**
* @expectedException \Intervention\Image\Exception\NotSupportedException
*/
public function testProcessAvifGd() public function testProcessAvifGd()
{ {
if (function_exists('imageavif')) {
$core = imagecreatefromjpeg(__DIR__.'/images/test.jpg'); $core = imagecreatefromjpeg(__DIR__.'/images/test.jpg');
$encoder = new GdEncoder; $encoder = new GdEncoder;
$image = Mockery::mock('\Intervention\Image\Image'); $image = Mockery::mock('\Intervention\Image\Image');
$image->shouldReceive('getCore')->once()->andReturn($core);
$image->shouldReceive('setEncoded')->once()->andReturn($image);
$img = $encoder->process($image, 'avif', 90); $img = $encoder->process($image, 'avif', 90);
$this->assertInstanceOf('Intervention\Image\Image', $img); $this->assertInstanceOf('Intervention\Image\Image', $img);
$this->assertEquals('image/avif; charset=binary', $this->getMime($encoder->result));
}
} }
/** /**