Skip to content

Commit 628cc1d

Browse files
committed
add grayscale CropModifier test
1 parent 7639f71 commit 628cc1d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/Unit/Modifiers/CropModifierTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,16 @@ public function testModifyCropAnimatedSmart(): void
8888
$this->assertEquals(15, $image->height());
8989
$this->assertColor(255, 166, 1, 255, $image->pickColor(8, 8));
9090
}
91+
92+
public function testCropGrayscale(): void
93+
{
94+
$image = $this->readTestImage('grayscale.jpg');
95+
$image->modify(new CropModifier(258, 258, 0, 0, 'ff0000', 'center'));
96+
$this->assertColor(255, 0, 0, 255, $image->pickColor(0, 0));
97+
$this->assertColor(255, 255, 255, 255, $image->pickColor(1, 1));
98+
$this->assertColor(0, 0, 0, 255, $image->pickColor(1, 256));
99+
100+
// Ensure the image is encodable
101+
$image->encode();
102+
}
91103
}

0 commit comments

Comments
 (0)