diff --git a/tests/Drivers/Imagick/Decoders/BinaryImageDecoderTest.php b/tests/Drivers/Imagick/Decoders/BinaryImageDecoderTest.php new file mode 100644 index 00000000..455bdcc7 --- /dev/null +++ b/tests/Drivers/Imagick/Decoders/BinaryImageDecoderTest.php @@ -0,0 +1,40 @@ +decode(file_get_contents(__DIR__ . '/../../../images/tile.png')); + $this->assertInstanceOf(Image::class, $image); + $this->assertEquals(16, $image->getWidth()); + $this->assertEquals(16, $image->getHeight()); + $this->assertCount(1, $image); + } + + public function testDecodeGif(): void + { + $decoder = new BinaryImageDecoder(); + $image = $decoder->decode(file_get_contents(__DIR__ . '/../../../images/red.gif')); + $this->assertInstanceOf(Image::class, $image); + $this->assertEquals(16, $image->getWidth()); + $this->assertEquals(16, $image->getHeight()); + $this->assertCount(1, $image); + } + + public function testDecodeAnimatedGif(): void + { + $decoder = new BinaryImageDecoder(); + $image = $decoder->decode(file_get_contents(__DIR__ . '/../../../images/cats.gif')); + $this->assertInstanceOf(Image::class, $image); + $this->assertEquals(75, $image->getWidth()); + $this->assertEquals(50, $image->getHeight()); + $this->assertCount(4, $image); + } +}