Skip to content

Commit

Permalink
Add test for CropModifier::class
Browse files Browse the repository at this point in the history
  • Loading branch information
olivervogel committed Jan 10, 2025
1 parent 955563a commit e0cc42c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/Unit/Drivers/Imagick/Modifiers/CropModifierTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,19 @@ public function testModifyExtend(): void
$this->assertTransparency($image->pickColor(460, 16));
}

public function testModifySinglePixel(): void
{
$image = $this->createTestImage(1, 1);
$this->assertEquals(1, $image->width());
$this->assertEquals(1, $image->height());
$image->modify(new CropModifier(3, 3, 0, 0, 'ff0', 'center'));
$this->assertEquals(3, $image->width());
$this->assertEquals(3, $image->height());
$this->assertColor(255, 255, 0, 255, $image->pickColor(0, 0));
$this->assertColor(255, 0, 0, 255, $image->pickColor(1, 1));
$this->assertColor(255, 255, 0, 255, $image->pickColor(2, 2));
}

public function testModifyKeepsColorspace(): void
{
$image = $this->readTestImage('cmyk.jpg');
Expand Down

0 comments on commit e0cc42c

Please sign in to comment.