From 84d2aaad76eee3d87e568a9587107195304feb9e Mon Sep 17 00:00:00 2001 From: Oliver Vogel Date: Sat, 2 Dec 2023 16:07:27 +0100 Subject: [PATCH] Add PadModifier tests --- .../Drivers/Gd/Modifiers/PadModifierTest.php | 29 +++++++++++++++++++ .../Imagick/Modifiers/PadModifierTest.php | 29 +++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 tests/Drivers/Gd/Modifiers/PadModifierTest.php create mode 100644 tests/Drivers/Imagick/Modifiers/PadModifierTest.php diff --git a/tests/Drivers/Gd/Modifiers/PadModifierTest.php b/tests/Drivers/Gd/Modifiers/PadModifierTest.php new file mode 100644 index 00000000..95dbe1c1 --- /dev/null +++ b/tests/Drivers/Gd/Modifiers/PadModifierTest.php @@ -0,0 +1,29 @@ +createTestImage('blocks.png'); + $this->assertEquals(640, $image->width()); + $this->assertEquals(480, $image->height()); + $image->modify(new PadModifier(200, 100, 'ff0')); + $this->assertEquals(200, $image->width()); + $this->assertEquals(100, $image->height()); + $this->assertColor(255, 255, 0, 255, $image->pickColor(0, 0)); + $this->assertColor(255, 0, 255, 0, $image->pickColor(140, 10)); + $this->assertColor(255, 255, 0, 255, $image->pickColor(175, 10)); + } +} diff --git a/tests/Drivers/Imagick/Modifiers/PadModifierTest.php b/tests/Drivers/Imagick/Modifiers/PadModifierTest.php new file mode 100644 index 00000000..9e65d93b --- /dev/null +++ b/tests/Drivers/Imagick/Modifiers/PadModifierTest.php @@ -0,0 +1,29 @@ +createTestImage('blocks.png'); + $this->assertEquals(640, $image->width()); + $this->assertEquals(480, $image->height()); + $image->modify(new PadModifier(200, 100, 'ff0')); + $this->assertEquals(200, $image->width()); + $this->assertEquals(100, $image->height()); + $this->assertColor(255, 255, 0, 255, $image->pickColor(0, 0)); + $this->assertColor(255, 0, 255, 0, $image->pickColor(140, 10)); + $this->assertColor(255, 255, 0, 255, $image->pickColor(175, 10)); + } +}