diff --git a/tests/Unit/Drivers/Gd/Modifiers/TrimModifierTest.php b/tests/Unit/Drivers/Gd/Modifiers/TrimModifierTest.php index d8c5efdf..c85c8c88 100644 --- a/tests/Unit/Drivers/Gd/Modifiers/TrimModifierTest.php +++ b/tests/Unit/Drivers/Gd/Modifiers/TrimModifierTest.php @@ -4,6 +4,7 @@ namespace Intervention\Image\Tests\Unit\Drivers\Gd\Modifiers; +use Intervention\Image\Exceptions\NotSupportedException; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\RequiresPhpExtension; use Intervention\Image\Modifiers\TrimModifier; @@ -44,4 +45,11 @@ public function testTrimHighTolerance(): void $this->assertEquals(1, $image->height()); $this->assertColor(255, 255, 255, 0, $image->pickColor(0, 0)); } + + public function testTrimAnimated(): void + { + $image = $this->readTestImage('animation.gif'); + $this->expectException(NotSupportedException::class); + $image->modify(new TrimModifier()); + } } diff --git a/tests/Unit/Drivers/Imagick/Modifiers/TrimModifierTest.php b/tests/Unit/Drivers/Imagick/Modifiers/TrimModifierTest.php index b881a7d0..cd2bafdd 100644 --- a/tests/Unit/Drivers/Imagick/Modifiers/TrimModifierTest.php +++ b/tests/Unit/Drivers/Imagick/Modifiers/TrimModifierTest.php @@ -4,6 +4,7 @@ namespace Intervention\Image\Tests\Unit\Drivers\Imagick\Modifiers; +use Intervention\Image\Exceptions\NotSupportedException; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\RequiresPhpExtension; use Intervention\Image\Modifiers\TrimModifier; @@ -44,4 +45,11 @@ public function testTrimHighTolerance(): void $this->assertEquals(1, $image->height()); $this->assertColor(255, 255, 255, 0, $image->pickColor(0, 0)); } + + public function testTrimAnimated(): void + { + $image = $this->readTestImage('animation.gif'); + $this->expectException(NotSupportedException::class); + $image->modify(new TrimModifier()); + } }