1
0
mirror of https://github.com/Intervention/image.git synced 2025-02-23 05:42:21 +01:00
intervention_image/tests/Drivers/Imagick/ImageFactoryTest.php
2023-10-21 17:47:35 +02:00

41 lines
1.1 KiB
PHP

<?php
namespace Intervention\Image\Tests\Drivers\Imagick;
use Imagick;
use Intervention\Image\Drivers\Imagick\Image;
use Intervention\Image\Drivers\Imagick\ImageFactory;
use Intervention\Image\Tests\TestCase;
/**
* @requires extension imagick
* @covers \Intervention\Image\Drivers\Imagick\ImageFactory
*/
class ImageFactoryTest extends TestCase
{
public function testNewImage(): void
{
$factory = new ImageFactory();
$image = $factory->newImage(3, 2);
$this->assertInstanceOf(Image::class, $image);
}
public function testNewAnimation(): void
{
$factory = new ImageFactory();
$image = $factory->newAnimation(function ($animation) {
$animation->add($this->getTestImagePath('blue.gif'), 1.2);
$animation->add($this->getTestImagePath('red.gif'), 1.2);
});
$this->assertInstanceOf(Image::class, $image);
$this->assertEquals(2, $image->count());
}
protected function testNewCore(): void
{
$factory = new ImageFactory();
$core = $factory->newCore(3, 2);
$this->assertInstanceOf(Imagick::class, $core);
}
}