From b6d815458cc3ccfc31893dc54faa5305313252fb Mon Sep 17 00:00:00 2001 From: Oliver Vogel Date: Sun, 4 Aug 2024 08:50:51 +0200 Subject: [PATCH] Add tests for EncodedImageObjectDecoder::class --- .../EncodedImageObjectDecoderTest.php | 32 +++++++++++++++++++ .../EncodedImageObjectDecoderTest.php | 32 +++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 tests/Unit/Drivers/Gd/Decoders/EncodedImageObjectDecoderTest.php create mode 100644 tests/Unit/Drivers/Imagick/Decoders/EncodedImageObjectDecoderTest.php diff --git a/tests/Unit/Drivers/Gd/Decoders/EncodedImageObjectDecoderTest.php b/tests/Unit/Drivers/Gd/Decoders/EncodedImageObjectDecoderTest.php new file mode 100644 index 00000000..f75762f1 --- /dev/null +++ b/tests/Unit/Drivers/Gd/Decoders/EncodedImageObjectDecoderTest.php @@ -0,0 +1,32 @@ +decoder = new EncodedImageObjectDecoder(); + $this->decoder->setDriver(new Driver()); + } + + public function testDecode(): void + { + $result = $this->decoder->decode(new EncodedImage($this->getTestResourceData())); + $this->assertInstanceOf(Image::class, $result); + } +} diff --git a/tests/Unit/Drivers/Imagick/Decoders/EncodedImageObjectDecoderTest.php b/tests/Unit/Drivers/Imagick/Decoders/EncodedImageObjectDecoderTest.php new file mode 100644 index 00000000..826498d3 --- /dev/null +++ b/tests/Unit/Drivers/Imagick/Decoders/EncodedImageObjectDecoderTest.php @@ -0,0 +1,32 @@ +decoder = new EncodedImageObjectDecoder(); + $this->decoder->setDriver(new Driver()); + } + + public function testDecode(): void + { + $result = $this->decoder->decode(new EncodedImage($this->getTestResourceData())); + $this->assertInstanceOf(Image::class, $result); + } +}