1
0
mirror of https://github.com/Intervention/image.git synced 2025-01-17 12:18:14 +01:00

add test unit

This commit is contained in:
Babichev Maxim 2019-06-10 11:07:42 +03:00
parent ab55fbb040
commit dcae042e71
No known key found for this signature in database
GPG Key ID: B171CF93F76DED4D

View File

@ -1,6 +1,7 @@
<?php
use Intervention\Image\Image;
use Intervention\Image\ImageManager;
use PHPUnit\Framework\TestCase;
class ImageTest extends TestCase
@ -44,6 +45,25 @@ class ImageTest extends TestCase
@unlink($save_as);
}
public function testFormatSave()
{
$save_as = __DIR__.'/tmp/test';
$config = ['driver' => new Intervention\Image\Imagick\Driver()];
$manager = new ImageManager($config);
$image = $manager->make('data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7');
$this->assertInstanceOf('Intervention\Image\Image', $image);
$this->assertInstanceOf('Imagick', $image->getCore());
$gifCore = $image->getCore();
$this->assertEquals($gifCore->getImageMimeType(), 'image/gif');
$image->save($save_as, null, 'jpg');
$this->assertEquals(\mime_content_type($save_as), 'image/jpeg');
@unlink($save_as);
}
public function testIsEncoded()
{
$image = $this->getTestImage();