Skip to content

Commit

Permalink
Add tests for trimming animated images
Browse files Browse the repository at this point in the history
  • Loading branch information
olivervogel committed Mar 24, 2024
1 parent 26cb611 commit d38a7ce
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/Unit/Drivers/Gd/Modifiers/TrimModifierTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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());
}
}
8 changes: 8 additions & 0 deletions tests/Unit/Drivers/Imagick/Modifiers/TrimModifierTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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());
}
}

0 comments on commit d38a7ce

Please sign in to comment.