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:
@@ -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));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user