From f4641342c3f2b4312eb3b40b2536c6f04b1b8b01 Mon Sep 17 00:00:00 2001 From: Oliver Vogel Date: Sat, 27 Jan 2024 20:19:25 +0100 Subject: [PATCH] Add tests --- tests/Modifiers/ColorspaceModifierTest.php | 30 ++++++++++++++++++++++ tests/Modifiers/PadModifierTest.php | 24 +++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 tests/Modifiers/ColorspaceModifierTest.php create mode 100644 tests/Modifiers/PadModifierTest.php diff --git a/tests/Modifiers/ColorspaceModifierTest.php b/tests/Modifiers/ColorspaceModifierTest.php new file mode 100644 index 00000000..c57bdf11 --- /dev/null +++ b/tests/Modifiers/ColorspaceModifierTest.php @@ -0,0 +1,30 @@ +assertInstanceOf(ColorspaceInterface::class, $modifier->targetColorspace()); + + $modifier = new ColorspaceModifier('rgb'); + $this->assertInstanceOf(ColorspaceInterface::class, $modifier->targetColorspace()); + + $modifier = new ColorspaceModifier('cmyk'); + $this->assertInstanceOf(ColorspaceInterface::class, $modifier->targetColorspace()); + + $modifier = new ColorspaceModifier('test'); + $this->expectException(NotSupportedException::class); + $modifier->targetColorspace(); + } +} diff --git a/tests/Modifiers/PadModifierTest.php b/tests/Modifiers/PadModifierTest.php new file mode 100644 index 00000000..36c01ceb --- /dev/null +++ b/tests/Modifiers/PadModifierTest.php @@ -0,0 +1,24 @@ +shouldReceive('size')->andReturn($size); + $this->assertInstanceOf(SizeInterface::class, $modifier->getCropSize($image)); + } +}