From de1eb734b6061dc7aa781a52f674b111817da634 Mon Sep 17 00:00:00 2001 From: Oliver Vogel Date: Fri, 12 Aug 2022 17:50:08 +0200 Subject: [PATCH] Add test for DrawPolygonModifiers --- .../Gd/Modifiers/DrawPolygonModifierTest.php | 28 +++++++++++++++++++ .../Modifiers/DrawPolygonModifierTest.php | 24 ++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 tests/Drivers/Gd/Modifiers/DrawPolygonModifierTest.php create mode 100644 tests/Drivers/Imagick/Modifiers/DrawPolygonModifierTest.php diff --git a/tests/Drivers/Gd/Modifiers/DrawPolygonModifierTest.php b/tests/Drivers/Gd/Modifiers/DrawPolygonModifierTest.php new file mode 100644 index 00000000..1b62a24a --- /dev/null +++ b/tests/Drivers/Gd/Modifiers/DrawPolygonModifierTest.php @@ -0,0 +1,28 @@ +createTestImage('trim.png'); + $this->assertEquals('00aef0', $image->pickColor(14, 14)->toHex()); + $drawable = new Polygon([new Point(0, 0), new Point(15, 15), new Point(20, 20)]); + $drawable->background('b53717'); + $image->modify(new DrawPolygonModifier($drawable)); + $this->assertEquals('b53717', $image->pickColor(14, 14)->toHex()); + } +} diff --git a/tests/Drivers/Imagick/Modifiers/DrawPolygonModifierTest.php b/tests/Drivers/Imagick/Modifiers/DrawPolygonModifierTest.php new file mode 100644 index 00000000..02ee6b2b --- /dev/null +++ b/tests/Drivers/Imagick/Modifiers/DrawPolygonModifierTest.php @@ -0,0 +1,24 @@ +createTestImage('trim.png'); + $this->assertEquals('00aef0', $image->pickColor(14, 14)->toHex()); + $drawable = new Polygon([new Point(0, 0), new Point(15, 15), new Point(20, 20)]); + $drawable->background('b53717'); + $image->modify(new DrawPolygonModifier($drawable)); + $this->assertEquals('b53717', $image->pickColor(14, 14)->toHex()); + } +}