From b9a16d4df6a9c5aa03b7a345210b3292c03734fc Mon Sep 17 00:00:00 2001 From: Oliver Vogel Date: Fri, 6 Dec 2024 17:32:55 +0100 Subject: [PATCH 1/2] Optimize tests --- tests/Feature/Gd/ConvertPngGif.php | 2 + tests/Feature/Imagick/ConvertPngGif.php | 2 + tests/Unit/Colors/Cmyk/ChannelTest.php | 51 ++++++++++--------- tests/Unit/Colors/Cmyk/ColorTest.php | 4 +- tests/Unit/Colors/Cmyk/ColorspaceTest.php | 2 +- .../Cmyk/Decoders/StringColorDecoderTest.php | 4 +- tests/Unit/Colors/Hsl/ChannelTest.php | 6 +-- .../Colors/Hsl/Channels/SaturationTest.php | 2 + tests/Unit/Colors/Hsl/ColorTest.php | 2 +- tests/Unit/Colors/Hsl/ColorspaceTest.php | 2 +- .../Hsl/Decoders/StringColorDecoderTest.php | 4 +- tests/Unit/Colors/Hsv/ChannelTest.php | 8 ++- .../Colors/Hsv/Channels/SaturationTest.php | 2 + tests/Unit/Colors/Hsv/Channels/ValueTest.php | 2 + tests/Unit/Colors/Hsv/ColorTest.php | 2 +- tests/Unit/Colors/Hsv/ColorspaceTest.php | 2 +- .../Hsv/Decoders/StringColorDecoderTest.php | 4 +- tests/Unit/Colors/Rgb/ChannelTest.php | 11 ++-- tests/Unit/Colors/Rgb/Channels/AlphaTest.php | 2 +- tests/Unit/Colors/Rgb/ColorTest.php | 4 +- tests/Unit/Colors/Rgb/ColorspaceTest.php | 2 +- .../Rgb/Decoders/HexColorDecoderTest.php | 4 +- .../Rgb/Decoders/HtmlColornameDecoderTest.php | 4 +- .../Rgb/Decoders/StringColorDecoderTest.php | 4 +- tests/Unit/Drivers/AbstractDecoderTest.php | 2 +- tests/Unit/Drivers/AbstractEncoderTest.php | 2 +- .../Gd/Analyzers/ColorspaceAnalyzerTest.php | 7 +-- .../Gd/Analyzers/HeightAnalyzerTest.php | 7 +-- .../Gd/Analyzers/PixelColorAnalyzerTest.php | 7 +-- .../Gd/Analyzers/PixelColorsAnalyzerTest.php | 7 +-- .../Gd/Analyzers/ResolutionAnalyzerTest.php | 7 +-- .../Gd/Analyzers/WidthAnalyzerTest.php | 7 +-- tests/Unit/Drivers/Gd/ClonerTest.php | 4 ++ tests/Unit/Drivers/Gd/ColorProcessorTest.php | 4 ++ tests/Unit/Drivers/Gd/CoreTest.php | 4 ++ .../Gd/Decoders/AbstractDecoderTest.php | 4 ++ .../Gd/Decoders/Base64ImageDecoderTest.php | 2 +- .../Gd/Decoders/BinaryImageDecoderTest.php | 2 +- .../Gd/Decoders/DataUriImageDecoderTest.php | 2 +- .../Gd/Decoders/FilePathImageDecoderTest.php | 2 +- .../Decoders/FilePointerImageDecoderTest.php | 2 +- .../Gd/Decoders/ImageObjectDecoderTest.php | 2 +- .../Decoders/SplFileInfoImageDecoderTest.php | 2 +- tests/Unit/Drivers/Gd/DriverTest.php | 4 ++ .../Drivers/Gd/Encoders/AvifEncoderTest.php | 5 +- .../Drivers/Gd/Encoders/BmpEncoderTest.php | 5 +- .../Drivers/Gd/Encoders/GifEncoderTest.php | 5 +- .../Drivers/Gd/Encoders/JpegEncoderTest.php | 8 +-- .../Drivers/Gd/Encoders/PngEncoderTest.php | 5 +- .../Drivers/Gd/Encoders/WebpEncoderTest.php | 5 +- tests/Unit/Drivers/Gd/FontProcessorTest.php | 4 ++ tests/Unit/Drivers/Gd/FrameTest.php | 2 +- tests/Unit/Drivers/Gd/ImageTest.php | 4 ++ .../Analyzers/ColorspaceAnalyzerTest.php | 7 +-- .../Imagick/Analyzers/HeightAnalyzerTest.php | 7 +-- .../Analyzers/PixelColorAnalyzerTest.php | 7 +-- .../Analyzers/PixelColorsAnalyzerTest.php | 7 +-- .../Imagick/Analyzers/ProfileAnalyzerTest.php | 7 +-- .../Analyzers/ResolutionAnalyzerTest.php | 7 +-- .../Imagick/Analyzers/WidthAnalyzerTest.php | 7 +-- .../Drivers/Imagick/ColorProcessorTest.php | 4 ++ tests/Unit/Drivers/Imagick/CoreTest.php | 4 ++ .../Decoders/Base64ImageDecoderTest.php | 2 +- .../Decoders/BinaryImageDecoderTest.php | 4 ++ .../Decoders/DataUriImageDecoderTest.php | 2 +- .../Decoders/FilePathImageDecoderTest.php | 2 +- .../Decoders/FilePointerImageDecoderTest.php | 2 +- .../Decoders/ImageObjectDecoderTest.php | 2 +- .../Decoders/SplFileInfoImageDecoderTest.php | 2 +- tests/Unit/Drivers/Imagick/DriverTest.php | 4 ++ .../Imagick/Encoders/AvifEncoderTest.php | 5 +- .../Imagick/Encoders/BmpEncoderTest.php | 5 +- .../Imagick/Encoders/GifEncoderTest.php | 5 +- .../Imagick/Encoders/HeicEncoderTest.php | 5 +- .../Imagick/Encoders/Jpeg2000EncoderTest.php | 5 +- .../Imagick/Encoders/JpegEncoderTest.php | 8 +-- .../Imagick/Encoders/PngEncoderTest.php | 5 +- .../Imagick/Encoders/TiffEncoderTest.php | 5 +- .../Imagick/Encoders/WebpEncoderTest.php | 5 +- .../Drivers/Imagick/FontProcessorTest.php | 4 ++ tests/Unit/Drivers/Imagick/FrameTest.php | 2 +- tests/Unit/Drivers/Imagick/ImageTest.php | 4 ++ .../Drivers/SpecializableAnalyzerTest.php | 4 +- .../Unit/Drivers/SpecializableDecoderTest.php | 2 + .../Drivers/SpecializableModifierTest.php | 2 + tests/Unit/EncodedImageTest.php | 2 +- .../Encoders/FileExtensionEncoderTest.php | 2 + tests/Unit/Encoders/MediaTypeEncoderTest.php | 2 + tests/Unit/FileExtensionTest.php | 2 + tests/Unit/FileTest.php | 2 +- tests/Unit/FormatTest.php | 2 + tests/Unit/Geometry/BezierTest.php | 2 +- tests/Unit/Geometry/CircleTest.php | 2 + tests/Unit/Geometry/EllipseTest.php | 2 + .../Geometry/Factories/BezierFactoryTest.php | 2 + .../Geometry/Factories/CircleFactoryTest.php | 2 + .../Unit/Geometry/Factories/DrawableTest.php | 2 + .../Geometry/Factories/EllipseFactoryTest.php | 2 + .../Geometry/Factories/LineFactoryTest.php | 2 + .../Geometry/Factories/PolygonFactoryTest.php | 2 + .../Factories/RectangleFactoryTest.php | 2 + tests/Unit/Geometry/LineTest.php | 2 + tests/Unit/Geometry/PixelTest.php | 11 ++-- tests/Unit/Geometry/PointTest.php | 2 +- tests/Unit/Geometry/PolygonTest.php | 2 +- tests/Unit/Geometry/RectangleResizerTest.php | 2 +- tests/Unit/Geometry/RectangleTest.php | 2 + .../Traits/HasBackgroundColorTest.php | 2 + tests/Unit/Geometry/Traits/HasBorderTest.php | 2 + tests/Unit/MediaTypeTest.php | 2 + tests/Unit/ModifierStackTest.php | 2 +- .../Unit/Modifiers/ColorspaceModifierTest.php | 2 + tests/Unit/Modifiers/PadModifierTest.php | 2 + tests/Unit/Modifiers/TextModifierTest.php | 2 + tests/Unit/OriginTest.php | 2 + tests/Unit/ResolutionTest.php | 2 +- tests/Unit/Typography/FontFactoryTest.php | 2 + tests/Unit/Typography/FontTest.php | 2 + tests/Unit/Typography/LineTest.php | 2 + tests/Unit/Typography/TextBlockTest.php | 2 + 120 files changed, 292 insertions(+), 185 deletions(-) diff --git a/tests/Feature/Gd/ConvertPngGif.php b/tests/Feature/Gd/ConvertPngGif.php index 6e5eab7cb..11a590bb8 100644 --- a/tests/Feature/Gd/ConvertPngGif.php +++ b/tests/Feature/Gd/ConvertPngGif.php @@ -6,7 +6,9 @@ use Intervention\Image\ImageManager; use Intervention\Image\Tests\GdTestCase; +use PHPUnit\Framework\Attributes\RequiresPhpExtension; +#[RequiresPhpExtension('gd')] class ConvertPngGif extends GdTestCase { public function testConversionKeepsTransparency(): void diff --git a/tests/Feature/Imagick/ConvertPngGif.php b/tests/Feature/Imagick/ConvertPngGif.php index d9bf11bf5..cb34ab8ed 100644 --- a/tests/Feature/Imagick/ConvertPngGif.php +++ b/tests/Feature/Imagick/ConvertPngGif.php @@ -6,7 +6,9 @@ use Intervention\Image\ImageManager; use Intervention\Image\Tests\ImagickTestCase; +use PHPUnit\Framework\Attributes\RequiresPhpExtension; +#[RequiresPhpExtension('imagick')] class ConvertPngGif extends ImagickTestCase { public function testConversionKeepsTransparency(): void diff --git a/tests/Unit/Colors/Cmyk/ChannelTest.php b/tests/Unit/Colors/Cmyk/ChannelTest.php index 1f58747e3..c397e3ce4 100644 --- a/tests/Unit/Colors/Cmyk/ChannelTest.php +++ b/tests/Unit/Colors/Cmyk/ChannelTest.php @@ -4,78 +4,79 @@ namespace Intervention\Image\Tests\Unit\Colors\Cmyk; -use PHPUnit\Framework\Attributes\CoversClass; -use PHPUnit\Framework\Attributes\RequiresPhpExtension; -use Intervention\Image\Colors\Cmyk\Channels\Cyan as Channel; +use Intervention\Image\Colors\Cmyk\Channels\Cyan; +use Intervention\Image\Colors\Cmyk\Channels\Key; +use Intervention\Image\Colors\Cmyk\Channels\Magenta; +use Intervention\Image\Colors\Cmyk\Channels\Yellow; use Intervention\Image\Exceptions\ColorException; use Intervention\Image\Tests\BaseTestCase; +use PHPUnit\Framework\Attributes\CoversClass; -#[RequiresPhpExtension('gd')] -#[CoversClass(\Intervention\Image\Colors\Cmyk\Channels\Cyan::class)] -#[CoversClass(\Intervention\Image\Colors\Cmyk\Channels\Magenta::class)] -#[CoversClass(\Intervention\Image\Colors\Cmyk\Channels\Yellow::class)] -#[CoversClass(\Intervention\Image\Colors\Cmyk\Channels\Key::class)] +#[CoversClass(Cyan::class)] +#[CoversClass(Magenta::class)] +#[CoversClass(Yellow::class)] +#[CoversClass(Key::class)] final class ChannelTest extends BaseTestCase { public function testConstructor(): void { - $channel = new Channel(0); - $this->assertInstanceOf(Channel::class, $channel); + $channel = new Cyan(0); + $this->assertInstanceOf(Cyan::class, $channel); - $channel = new Channel(value: 0); - $this->assertInstanceOf(Channel::class, $channel); + $channel = new Cyan(value: 0); + $this->assertInstanceOf(Cyan::class, $channel); - $channel = new Channel(normalized: 0); - $this->assertInstanceOf(Channel::class, $channel); + $channel = new Cyan(normalized: 0); + $this->assertInstanceOf(Cyan::class, $channel); $this->expectException(ColorException::class); - new Channel(); + new Cyan(); $this->expectException(ColorException::class); - new Channel(normalized: 2); + new Cyan(normalized: 2); } public function testConstructorFail(): void { $this->expectException(ColorException::class); - new Channel(200); + new Cyan(200); } public function testToInt(): void { - $channel = new Channel(10); + $channel = new Cyan(10); $this->assertEquals(10, $channel->toInt()); } public function testToString(): void { - $channel = new Channel(10); + $channel = new Cyan(10); $this->assertEquals("10", $channel->toString()); $this->assertEquals("10", (string) $channel); } public function testValue(): void { - $channel = new Channel(10); + $channel = new Cyan(10); $this->assertEquals(10, $channel->value()); } public function testNormalize(): void { - $channel = new Channel(100); + $channel = new Cyan(100); $this->assertEquals(1, $channel->normalize()); - $channel = new Channel(0); + $channel = new Cyan(0); $this->assertEquals(0, $channel->normalize()); - $channel = new Channel(20); + $channel = new Cyan(20); $this->assertEquals(.2, $channel->normalize()); } public function testValidate(): void { $this->expectException(ColorException::class); - new Channel(101); + new Cyan(101); $this->expectException(ColorException::class); - new Channel(-1); + new Cyan(-1); } } diff --git a/tests/Unit/Colors/Cmyk/ColorTest.php b/tests/Unit/Colors/Cmyk/ColorTest.php index 7fae9ea41..f860bba8f 100644 --- a/tests/Unit/Colors/Cmyk/ColorTest.php +++ b/tests/Unit/Colors/Cmyk/ColorTest.php @@ -5,7 +5,6 @@ namespace Intervention\Image\Tests\Unit\Colors\Cmyk; use PHPUnit\Framework\Attributes\CoversClass; -use PHPUnit\Framework\Attributes\RequiresPhpExtension; use Intervention\Image\Colors\Cmyk\Channels\Cyan; use Intervention\Image\Colors\Cmyk\Channels\Key; use Intervention\Image\Colors\Cmyk\Channels\Magenta; @@ -15,8 +14,7 @@ use Intervention\Image\Exceptions\ColorException; use Intervention\Image\Tests\BaseTestCase; -#[RequiresPhpExtension('gd')] -#[CoversClass(\Intervention\Image\Colors\Cmyk\Color::class)] +#[CoversClass(Color::class)] final class ColorTest extends BaseTestCase { public function testConstructor(): void diff --git a/tests/Unit/Colors/Cmyk/ColorspaceTest.php b/tests/Unit/Colors/Cmyk/ColorspaceTest.php index 83cf00d98..a62a6be1f 100644 --- a/tests/Unit/Colors/Cmyk/ColorspaceTest.php +++ b/tests/Unit/Colors/Cmyk/ColorspaceTest.php @@ -16,7 +16,7 @@ use Intervention\Image\Colors\Cmyk\Colorspace; use Intervention\Image\Tests\BaseTestCase; -#[CoversClass(\Intervention\Image\Colors\Cmyk\Colorspace::class)] +#[CoversClass(Colorspace::class)] final class ColorspaceTest extends BaseTestCase { public function testColorFromNormalized(): void diff --git a/tests/Unit/Colors/Cmyk/Decoders/StringColorDecoderTest.php b/tests/Unit/Colors/Cmyk/Decoders/StringColorDecoderTest.php index e24996b8e..9a8ceafdd 100644 --- a/tests/Unit/Colors/Cmyk/Decoders/StringColorDecoderTest.php +++ b/tests/Unit/Colors/Cmyk/Decoders/StringColorDecoderTest.php @@ -5,14 +5,12 @@ namespace Intervention\Image\Tests\Unit\Colors\Cmyk\Decoders; use PHPUnit\Framework\Attributes\CoversClass; -use PHPUnit\Framework\Attributes\RequiresPhpExtension; use Intervention\Image\Colors\Cmyk\Color; use Intervention\Image\Colors\Cmyk\Decoders\StringColorDecoder; use Intervention\Image\Exceptions\DecoderException; use Intervention\Image\Tests\BaseTestCase; -#[RequiresPhpExtension('gd')] -#[CoversClass(\Intervention\Image\Colors\Cmyk\Decoders\StringColorDecoder::class)] +#[CoversClass(StringColorDecoder::class)] final class StringColorDecoderTest extends BaseTestCase { public function testDecode(): void diff --git a/tests/Unit/Colors/Hsl/ChannelTest.php b/tests/Unit/Colors/Hsl/ChannelTest.php index 11166f279..630e955b6 100644 --- a/tests/Unit/Colors/Hsl/ChannelTest.php +++ b/tests/Unit/Colors/Hsl/ChannelTest.php @@ -11,9 +11,9 @@ use Intervention\Image\Exceptions\ColorException; use Intervention\Image\Tests\BaseTestCase; -#[CoversClass(\Intervention\Image\Colors\Hsl\Channels\Hue::class)] -#[CoversClass(\Intervention\Image\Colors\Hsl\Channels\Saturation::class)] -#[CoversClass(\Intervention\Image\Colors\Hsl\Channels\Luminance::class)] +#[CoversClass(Hue::class)] +#[CoversClass(Saturation::class)] +#[CoversClass(Luminance::class)] final class ChannelTest extends BaseTestCase { public function testConstructor(): void diff --git a/tests/Unit/Colors/Hsl/Channels/SaturationTest.php b/tests/Unit/Colors/Hsl/Channels/SaturationTest.php index a97da881f..8ff4564c2 100644 --- a/tests/Unit/Colors/Hsl/Channels/SaturationTest.php +++ b/tests/Unit/Colors/Hsl/Channels/SaturationTest.php @@ -6,7 +6,9 @@ use Intervention\Image\Colors\Hsl\Channels\Saturation; use Intervention\Image\Tests\BaseTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +#[CoversClass(Saturation::class)] final class SaturationTest extends BaseTestCase { public function testMinMax(): void diff --git a/tests/Unit/Colors/Hsl/ColorTest.php b/tests/Unit/Colors/Hsl/ColorTest.php index 749d21b00..82dda47e6 100644 --- a/tests/Unit/Colors/Hsl/ColorTest.php +++ b/tests/Unit/Colors/Hsl/ColorTest.php @@ -13,7 +13,7 @@ use Intervention\Image\Exceptions\ColorException; use Intervention\Image\Tests\BaseTestCase; -#[CoversClass(\Intervention\Image\Colors\Hsl\Color::class)] +#[CoversClass(Color::class)] final class ColorTest extends BaseTestCase { public function testConstructor(): void diff --git a/tests/Unit/Colors/Hsl/ColorspaceTest.php b/tests/Unit/Colors/Hsl/ColorspaceTest.php index 11574012a..eaf6b0365 100644 --- a/tests/Unit/Colors/Hsl/ColorspaceTest.php +++ b/tests/Unit/Colors/Hsl/ColorspaceTest.php @@ -15,7 +15,7 @@ use Intervention\Image\Colors\Hsl\Colorspace; use Intervention\Image\Tests\BaseTestCase; -#[CoversClass(\Intervention\Image\Colors\Hsl\Colorspace::class)] +#[CoversClass(Colorspace::class)] final class ColorspaceTest extends BaseTestCase { public function testColorFromNormalized(): void diff --git a/tests/Unit/Colors/Hsl/Decoders/StringColorDecoderTest.php b/tests/Unit/Colors/Hsl/Decoders/StringColorDecoderTest.php index b7d2da5c1..447ebd64f 100644 --- a/tests/Unit/Colors/Hsl/Decoders/StringColorDecoderTest.php +++ b/tests/Unit/Colors/Hsl/Decoders/StringColorDecoderTest.php @@ -6,14 +6,12 @@ use Generator; use PHPUnit\Framework\Attributes\CoversClass; -use PHPUnit\Framework\Attributes\RequiresPhpExtension; use Intervention\Image\Colors\Hsl\Color; use Intervention\Image\Colors\Hsl\Decoders\StringColorDecoder; use Intervention\Image\Tests\BaseTestCase; use PHPUnit\Framework\Attributes\DataProvider; -#[RequiresPhpExtension('gd')] -#[CoversClass(\Intervention\Image\Colors\Hsl\Decoders\StringColorDecoder::class)] +#[CoversClass(StringColorDecoder::class)] final class StringColorDecoderTest extends BaseTestCase { #[DataProvider('decodeDataProvier')] diff --git a/tests/Unit/Colors/Hsv/ChannelTest.php b/tests/Unit/Colors/Hsv/ChannelTest.php index e3aca085b..5942dc086 100644 --- a/tests/Unit/Colors/Hsv/ChannelTest.php +++ b/tests/Unit/Colors/Hsv/ChannelTest.php @@ -5,17 +5,15 @@ namespace Intervention\Image\Tests\Unit\Colors\Hsv; use PHPUnit\Framework\Attributes\CoversClass; -use PHPUnit\Framework\Attributes\RequiresPhpExtension; use Intervention\Image\Colors\Hsv\Channels\Hue; use Intervention\Image\Colors\Hsv\Channels\Saturation; use Intervention\Image\Colors\Hsv\Channels\Value; use Intervention\Image\Exceptions\ColorException; use Intervention\Image\Tests\BaseTestCase; -#[RequiresPhpExtension('gd')] -#[CoversClass(\Intervention\Image\Colors\Hsv\Channels\Hue::class)] -#[CoversClass(\Intervention\Image\Colors\Hsv\Channels\Saturation::class)] -#[CoversClass(\Intervention\Image\Colors\Hsv\Channels\Value::class)] +#[CoversClass(Hue::class)] +#[CoversClass(Saturation::class)] +#[CoversClass(Value::class)] final class ChannelTest extends BaseTestCase { public function testConstructor(): void diff --git a/tests/Unit/Colors/Hsv/Channels/SaturationTest.php b/tests/Unit/Colors/Hsv/Channels/SaturationTest.php index db273448b..a1ff904f4 100644 --- a/tests/Unit/Colors/Hsv/Channels/SaturationTest.php +++ b/tests/Unit/Colors/Hsv/Channels/SaturationTest.php @@ -6,7 +6,9 @@ use Intervention\Image\Colors\Hsv\Channels\Saturation; use Intervention\Image\Tests\BaseTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +#[CoversClass(Saturation::class)] final class SaturationTest extends BaseTestCase { public function testMinMax(): void diff --git a/tests/Unit/Colors/Hsv/Channels/ValueTest.php b/tests/Unit/Colors/Hsv/Channels/ValueTest.php index 7a49d592c..2278aabc5 100644 --- a/tests/Unit/Colors/Hsv/Channels/ValueTest.php +++ b/tests/Unit/Colors/Hsv/Channels/ValueTest.php @@ -6,7 +6,9 @@ use Intervention\Image\Colors\Hsv\Channels\Value; use Intervention\Image\Tests\BaseTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +#[CoversClass(Value::class)] final class ValueTest extends BaseTestCase { public function testMinMax(): void diff --git a/tests/Unit/Colors/Hsv/ColorTest.php b/tests/Unit/Colors/Hsv/ColorTest.php index f4a270b22..8827f59c0 100644 --- a/tests/Unit/Colors/Hsv/ColorTest.php +++ b/tests/Unit/Colors/Hsv/ColorTest.php @@ -13,7 +13,7 @@ use Intervention\Image\Exceptions\ColorException; use Intervention\Image\Tests\BaseTestCase; -#[CoversClass(\Intervention\Image\Colors\Hsv\Color::class)] +#[CoversClass(Color::class)] final class ColorTest extends BaseTestCase { public function testConstructor(): void diff --git a/tests/Unit/Colors/Hsv/ColorspaceTest.php b/tests/Unit/Colors/Hsv/ColorspaceTest.php index ed6867a13..83b98a521 100644 --- a/tests/Unit/Colors/Hsv/ColorspaceTest.php +++ b/tests/Unit/Colors/Hsv/ColorspaceTest.php @@ -15,7 +15,7 @@ use Intervention\Image\Colors\Hsv\Colorspace; use Intervention\Image\Tests\BaseTestCase; -#[CoversClass(\Intervention\Image\Colors\Hsv\Colorspace::class)] +#[CoversClass(Colorspace::class)] final class ColorspaceTest extends BaseTestCase { public function testColorFromNormalized(): void diff --git a/tests/Unit/Colors/Hsv/Decoders/StringColorDecoderTest.php b/tests/Unit/Colors/Hsv/Decoders/StringColorDecoderTest.php index 1500d882f..34da08743 100644 --- a/tests/Unit/Colors/Hsv/Decoders/StringColorDecoderTest.php +++ b/tests/Unit/Colors/Hsv/Decoders/StringColorDecoderTest.php @@ -6,14 +6,12 @@ use Generator; use PHPUnit\Framework\Attributes\CoversClass; -use PHPUnit\Framework\Attributes\RequiresPhpExtension; use Intervention\Image\Colors\Hsv\Color; use Intervention\Image\Colors\Hsv\Decoders\StringColorDecoder; use Intervention\Image\Tests\BaseTestCase; use PHPUnit\Framework\Attributes\DataProvider; -#[RequiresPhpExtension('gd')] -#[CoversClass(\Intervention\Image\Colors\Hsv\Decoders\StringColorDecoder::class)] +#[CoversClass(StringColorDecoder::class)] final class StringColorDecoderTest extends BaseTestCase { #[DataProvider('decodeDataProvier')] diff --git a/tests/Unit/Colors/Rgb/ChannelTest.php b/tests/Unit/Colors/Rgb/ChannelTest.php index a61ef50d7..01c4a3902 100644 --- a/tests/Unit/Colors/Rgb/ChannelTest.php +++ b/tests/Unit/Colors/Rgb/ChannelTest.php @@ -4,16 +4,17 @@ namespace Intervention\Image\Tests\Unit\Colors\Rgb; +use Intervention\Image\Colors\Rgb\Channels\Blue; +use Intervention\Image\Colors\Rgb\Channels\Green; use PHPUnit\Framework\Attributes\CoversClass; -use PHPUnit\Framework\Attributes\RequiresPhpExtension; use Intervention\Image\Colors\Rgb\Channels\Red as Channel; +use Intervention\Image\Colors\Rgb\Channels\Red; use Intervention\Image\Exceptions\ColorException; use Intervention\Image\Tests\BaseTestCase; -#[RequiresPhpExtension('gd')] -#[CoversClass(\Intervention\Image\Colors\Rgb\Channels\Red::class)] -#[CoversClass(\Intervention\Image\Colors\Rgb\Channels\Green::class)] -#[CoversClass(\Intervention\Image\Colors\Rgb\Channels\Blue::class)] +#[CoversClass(Red::class)] +#[CoversClass(Green::class)] +#[CoversClass(Blue::class)] final class ChannelTest extends BaseTestCase { public function testConstructor(): void diff --git a/tests/Unit/Colors/Rgb/Channels/AlphaTest.php b/tests/Unit/Colors/Rgb/Channels/AlphaTest.php index cc6432bce..0faec9ebd 100644 --- a/tests/Unit/Colors/Rgb/Channels/AlphaTest.php +++ b/tests/Unit/Colors/Rgb/Channels/AlphaTest.php @@ -8,7 +8,7 @@ use Intervention\Image\Colors\Rgb\Channels\Alpha; use Intervention\Image\Tests\BaseTestCase; -#[CoversClass(\Intervention\Image\Colors\Rgb\Channels\Alpha::class)] +#[CoversClass(Alpha::class)] final class AlphaTest extends BaseTestCase { public function testToString(): void diff --git a/tests/Unit/Colors/Rgb/ColorTest.php b/tests/Unit/Colors/Rgb/ColorTest.php index 16bfd1edd..c1d159a4d 100644 --- a/tests/Unit/Colors/Rgb/ColorTest.php +++ b/tests/Unit/Colors/Rgb/ColorTest.php @@ -5,7 +5,6 @@ namespace Intervention\Image\Tests\Unit\Colors\Rgb; use PHPUnit\Framework\Attributes\CoversClass; -use PHPUnit\Framework\Attributes\RequiresPhpExtension; use Intervention\Image\Colors\Cmyk\Color as CmykColor; use Intervention\Image\Colors\Cmyk\Colorspace as CmykColorspace; use Intervention\Image\Colors\Rgb\Channels\Red; @@ -16,8 +15,7 @@ use Intervention\Image\Exceptions\ColorException; use Intervention\Image\Tests\BaseTestCase; -#[RequiresPhpExtension('gd')] -#[CoversClass(\Intervention\Image\Colors\Rgb\Color::class)] +#[CoversClass(Color::class)] final class ColorTest extends BaseTestCase { public function testConstructor(): void diff --git a/tests/Unit/Colors/Rgb/ColorspaceTest.php b/tests/Unit/Colors/Rgb/ColorspaceTest.php index 5d4d5ec84..081ae971c 100644 --- a/tests/Unit/Colors/Rgb/ColorspaceTest.php +++ b/tests/Unit/Colors/Rgb/ColorspaceTest.php @@ -16,7 +16,7 @@ use Intervention\Image\Colors\Rgb\Colorspace; use Intervention\Image\Tests\BaseTestCase; -#[CoversClass(\Intervention\Image\Colors\Rgb\Colorspace::class)] +#[CoversClass(Colorspace::class)] final class ColorspaceTest extends BaseTestCase { public function testColorFromNormalized(): void diff --git a/tests/Unit/Colors/Rgb/Decoders/HexColorDecoderTest.php b/tests/Unit/Colors/Rgb/Decoders/HexColorDecoderTest.php index f4cd8354d..3d510f4e6 100644 --- a/tests/Unit/Colors/Rgb/Decoders/HexColorDecoderTest.php +++ b/tests/Unit/Colors/Rgb/Decoders/HexColorDecoderTest.php @@ -6,14 +6,12 @@ use Generator; use PHPUnit\Framework\Attributes\CoversClass; -use PHPUnit\Framework\Attributes\RequiresPhpExtension; use Intervention\Image\Colors\Rgb\Color; use Intervention\Image\Colors\Rgb\Decoders\HexColorDecoder; use Intervention\Image\Tests\BaseTestCase; use PHPUnit\Framework\Attributes\DataProvider; -#[RequiresPhpExtension('gd')] -#[CoversClass(\Intervention\Image\Colors\Rgb\Decoders\HexColorDecoder::class)] +#[CoversClass(HexColorDecoder::class)] final class HexColorDecoderTest extends BaseTestCase { #[DataProvider('decodeDataProvier')] diff --git a/tests/Unit/Colors/Rgb/Decoders/HtmlColornameDecoderTest.php b/tests/Unit/Colors/Rgb/Decoders/HtmlColornameDecoderTest.php index e6b84029b..ddb88f9f3 100644 --- a/tests/Unit/Colors/Rgb/Decoders/HtmlColornameDecoderTest.php +++ b/tests/Unit/Colors/Rgb/Decoders/HtmlColornameDecoderTest.php @@ -6,14 +6,12 @@ use Generator; use PHPUnit\Framework\Attributes\CoversClass; -use PHPUnit\Framework\Attributes\RequiresPhpExtension; use Intervention\Image\Colors\Rgb\Color; use Intervention\Image\Colors\Rgb\Decoders\HtmlColornameDecoder; use Intervention\Image\Tests\BaseTestCase; use PHPUnit\Framework\Attributes\DataProvider; -#[RequiresPhpExtension('gd')] -#[CoversClass(\Intervention\Image\Colors\Rgb\Decoders\HtmlColorNameDecoder::class)] +#[CoversClass(HtmlColorNameDecoder::class)] final class HtmlColornameDecoderTest extends BaseTestCase { #[DataProvider('decodeDataProvier')] diff --git a/tests/Unit/Colors/Rgb/Decoders/StringColorDecoderTest.php b/tests/Unit/Colors/Rgb/Decoders/StringColorDecoderTest.php index 5f6503f16..951406c8d 100644 --- a/tests/Unit/Colors/Rgb/Decoders/StringColorDecoderTest.php +++ b/tests/Unit/Colors/Rgb/Decoders/StringColorDecoderTest.php @@ -6,14 +6,12 @@ use Generator; use PHPUnit\Framework\Attributes\CoversClass; -use PHPUnit\Framework\Attributes\RequiresPhpExtension; use Intervention\Image\Colors\Rgb\Color; use Intervention\Image\Colors\Rgb\Decoders\StringColorDecoder; use Intervention\Image\Tests\BaseTestCase; use PHPUnit\Framework\Attributes\DataProvider; -#[RequiresPhpExtension('gd')] -#[CoversClass(\Intervention\Image\Colors\Rgb\Decoders\StringColorDecoder::class)] +#[CoversClass(StringColorDecoder::class)] final class StringColorDecoderTest extends BaseTestCase { #[DataProvider('decodeDataProvier')] diff --git a/tests/Unit/Drivers/AbstractDecoderTest.php b/tests/Unit/Drivers/AbstractDecoderTest.php index 2a9ff77fa..815923e3f 100644 --- a/tests/Unit/Drivers/AbstractDecoderTest.php +++ b/tests/Unit/Drivers/AbstractDecoderTest.php @@ -14,7 +14,7 @@ use Mockery; use stdClass; -#[CoversClass(\Intervention\Image\Drivers\AbstractDecoder::class)] +#[CoversClass(AbstractDecoder::class)] final class AbstractDecoderTest extends BaseTestCase { public function testIsGifFormat(): void diff --git a/tests/Unit/Drivers/AbstractEncoderTest.php b/tests/Unit/Drivers/AbstractEncoderTest.php index 26797b780..d3c1ead86 100644 --- a/tests/Unit/Drivers/AbstractEncoderTest.php +++ b/tests/Unit/Drivers/AbstractEncoderTest.php @@ -11,7 +11,7 @@ use Mockery; use PHPUnit\Metadata\CoversClass; -#[CoversClass(\Intervention\Image\Drivers\AbstractEncoder::class)] +#[CoversClass(AbstractEncoder::class)] final class AbstractEncoderTest extends BaseTestCase { public function testEncode(): void diff --git a/tests/Unit/Drivers/Gd/Analyzers/ColorspaceAnalyzerTest.php b/tests/Unit/Drivers/Gd/Analyzers/ColorspaceAnalyzerTest.php index 1b345ddce..1cb0a0c4d 100644 --- a/tests/Unit/Drivers/Gd/Analyzers/ColorspaceAnalyzerTest.php +++ b/tests/Unit/Drivers/Gd/Analyzers/ColorspaceAnalyzerTest.php @@ -4,21 +4,22 @@ namespace Intervention\Image\Tests\Unit\Drivers\Gd\Analyzers; +use Intervention\Image\Drivers\Gd\Analyzers\ColorspaceAnalyzer; +use Intervention\Image\Drivers\Gd\Driver; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\RequiresPhpExtension; -use Intervention\Image\Analyzers\ColorspaceAnalyzer; use Intervention\Image\Interfaces\ColorspaceInterface; use Intervention\Image\Tests\GdTestCase; #[RequiresPhpExtension('gd')] -#[CoversClass(\Intervention\Image\Analyzers\ColorspaceAnalyzer::class)] -#[CoversClass(\Intervention\Image\Drivers\Imagick\Analyzers\ColorspaceAnalyzer::class)] +#[CoversClass(ColorspaceAnalyzer::class)] final class ColorspaceAnalyzerTest extends GdTestCase { public function testAnalyze(): void { $image = $this->readTestImage('tile.png'); $analyzer = new ColorspaceAnalyzer(); + $analyzer->setDriver(new Driver()); $result = $analyzer->analyze($image); $this->assertInstanceOf(ColorspaceInterface::class, $result); } diff --git a/tests/Unit/Drivers/Gd/Analyzers/HeightAnalyzerTest.php b/tests/Unit/Drivers/Gd/Analyzers/HeightAnalyzerTest.php index a13c674ee..a8f243949 100644 --- a/tests/Unit/Drivers/Gd/Analyzers/HeightAnalyzerTest.php +++ b/tests/Unit/Drivers/Gd/Analyzers/HeightAnalyzerTest.php @@ -4,20 +4,21 @@ namespace Intervention\Image\Tests\Unit\Drivers\Gd\Analyzers; +use Intervention\Image\Drivers\Gd\Analyzers\HeightAnalyzer; +use Intervention\Image\Drivers\Gd\Driver; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\RequiresPhpExtension; -use Intervention\Image\Analyzers\HeightAnalyzer; use Intervention\Image\Tests\GdTestCase; #[RequiresPhpExtension('gd')] -#[CoversClass(\Intervention\Image\Analyzers\HeightAnalyzer::class)] -#[CoversClass(\Intervention\Image\Drivers\Imagick\Analyzers\HeightAnalyzer::class)] +#[CoversClass(HeightAnalyzer::class)] final class HeightAnalyzerTest extends GdTestCase { public function testAnalyze(): void { $image = $this->readTestImage('tile.png'); $analyzer = new HeightAnalyzer(); + $analyzer->setDriver(new Driver()); $result = $analyzer->analyze($image); $this->assertEquals(16, $result); } diff --git a/tests/Unit/Drivers/Gd/Analyzers/PixelColorAnalyzerTest.php b/tests/Unit/Drivers/Gd/Analyzers/PixelColorAnalyzerTest.php index 7257d02c9..363ed8836 100644 --- a/tests/Unit/Drivers/Gd/Analyzers/PixelColorAnalyzerTest.php +++ b/tests/Unit/Drivers/Gd/Analyzers/PixelColorAnalyzerTest.php @@ -4,21 +4,22 @@ namespace Intervention\Image\Tests\Unit\Drivers\Gd\Analyzers; +use Intervention\Image\Drivers\Gd\Analyzers\PixelColorAnalyzer; +use Intervention\Image\Drivers\Gd\Driver; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\RequiresPhpExtension; -use Intervention\Image\Analyzers\PixelColorAnalyzer; use Intervention\Image\Interfaces\ColorInterface; use Intervention\Image\Tests\GdTestCase; #[RequiresPhpExtension('gd')] -#[CoversClass(\Intervention\Image\Analyzers\PixelColorAnalyzer::class)] -#[CoversClass(\Intervention\Image\Drivers\Imagick\Analyzers\PixelColorAnalyzer::class)] +#[CoversClass(PixelColorAnalyzer::class)] final class PixelColorAnalyzerTest extends GdTestCase { public function testAnalyze(): void { $image = $this->readTestImage('tile.png'); $analyzer = new PixelColorAnalyzer(0, 0); + $analyzer->setDriver(new Driver()); $result = $analyzer->analyze($image); $this->assertInstanceOf(ColorInterface::class, $result); $this->assertEquals('b4e000', $result->toHex()); diff --git a/tests/Unit/Drivers/Gd/Analyzers/PixelColorsAnalyzerTest.php b/tests/Unit/Drivers/Gd/Analyzers/PixelColorsAnalyzerTest.php index c895712e8..9afa671f3 100644 --- a/tests/Unit/Drivers/Gd/Analyzers/PixelColorsAnalyzerTest.php +++ b/tests/Unit/Drivers/Gd/Analyzers/PixelColorsAnalyzerTest.php @@ -6,20 +6,21 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\RequiresPhpExtension; -use Intervention\Image\Analyzers\PixelColorsAnalyzer; use Intervention\Image\Collection; +use Intervention\Image\Drivers\Gd\Analyzers\PixelColorsAnalyzer; +use Intervention\Image\Drivers\Gd\Driver; use Intervention\Image\Interfaces\ColorInterface; use Intervention\Image\Tests\GdTestCase; #[RequiresPhpExtension('gd')] -#[CoversClass(\Intervention\Image\Analyzers\PixelColorsAnalyzer::class)] -#[CoversClass(\Intervention\Image\Drivers\Imagick\Analyzers\PixelColorsAnalyzer::class)] +#[CoversClass(PixelColorsAnalyzer::class)] final class PixelColorsAnalyzerTest extends GdTestCase { public function testAnalyze(): void { $image = $this->readTestImage('tile.png'); $analyzer = new PixelColorsAnalyzer(0, 0); + $analyzer->setDriver(new Driver()); $result = $analyzer->analyze($image); $this->assertInstanceOf(Collection::class, $result); $this->assertInstanceOf(ColorInterface::class, $result->first()); diff --git a/tests/Unit/Drivers/Gd/Analyzers/ResolutionAnalyzerTest.php b/tests/Unit/Drivers/Gd/Analyzers/ResolutionAnalyzerTest.php index f60684578..7b63c31af 100644 --- a/tests/Unit/Drivers/Gd/Analyzers/ResolutionAnalyzerTest.php +++ b/tests/Unit/Drivers/Gd/Analyzers/ResolutionAnalyzerTest.php @@ -4,21 +4,22 @@ namespace Intervention\Image\Tests\Unit\Drivers\Gd\Analyzers; +use Intervention\Image\Drivers\Gd\Analyzers\ResolutionAnalyzer; +use Intervention\Image\Drivers\Gd\Driver; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\RequiresPhpExtension; -use Intervention\Image\Analyzers\ResolutionAnalyzer; use Intervention\Image\Resolution; use Intervention\Image\Tests\GdTestCase; #[RequiresPhpExtension('gd')] -#[CoversClass(\Intervention\Image\Analyzers\ResolutionAnalyzer::class)] -#[CoversClass(\Intervention\Image\Drivers\Imagick\Analyzers\ResolutionAnalyzer::class)] +#[CoversClass(ResolutionAnalyzer::class)] final class ResolutionAnalyzerTest extends GdTestCase { public function testAnalyze(): void { $image = $this->readTestImage('tile.png'); $analyzer = new ResolutionAnalyzer(); + $analyzer->setDriver(new Driver()); $result = $analyzer->analyze($image); $this->assertInstanceOf(Resolution::class, $result); } diff --git a/tests/Unit/Drivers/Gd/Analyzers/WidthAnalyzerTest.php b/tests/Unit/Drivers/Gd/Analyzers/WidthAnalyzerTest.php index 7caea47b2..db3032c13 100644 --- a/tests/Unit/Drivers/Gd/Analyzers/WidthAnalyzerTest.php +++ b/tests/Unit/Drivers/Gd/Analyzers/WidthAnalyzerTest.php @@ -4,20 +4,21 @@ namespace Intervention\Image\Tests\Unit\Drivers\Gd\Analyzers; +use Intervention\Image\Drivers\Gd\Analyzers\WidthAnalyzer; +use Intervention\Image\Drivers\Gd\Driver; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\RequiresPhpExtension; -use Intervention\Image\Analyzers\WidthAnalyzer; use Intervention\Image\Tests\GdTestCase; #[RequiresPhpExtension('gd')] -#[CoversClass(\Intervention\Image\Analyzers\WidthAnalyzer::class)] -#[CoversClass(\Intervention\Image\Drivers\Imagick\Analyzers\WidthAnalyzer::class)] +#[CoversClass(WidthAnalyzer::class)] final class WidthAnalyzerTest extends GdTestCase { public function testAnalyze(): void { $image = $this->readTestImage('tile.png'); $analyzer = new WidthAnalyzer(); + $analyzer->setDriver(new Driver()); $result = $analyzer->analyze($image); $this->assertEquals(16, $result); } diff --git a/tests/Unit/Drivers/Gd/ClonerTest.php b/tests/Unit/Drivers/Gd/ClonerTest.php index 7fd396991..c9f84f3fd 100644 --- a/tests/Unit/Drivers/Gd/ClonerTest.php +++ b/tests/Unit/Drivers/Gd/ClonerTest.php @@ -8,7 +8,11 @@ use Intervention\Image\Drivers\Gd\Cloner; use Intervention\Image\Geometry\Rectangle; use Intervention\Image\Tests\BaseTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\RequiresPhpExtension; +#[RequiresPhpExtension('gd')] +#[CoversClass(Cloner::class)] final class ClonerTest extends BaseTestCase { public function testClone(): void diff --git a/tests/Unit/Drivers/Gd/ColorProcessorTest.php b/tests/Unit/Drivers/Gd/ColorProcessorTest.php index 8e214c938..9d574360b 100644 --- a/tests/Unit/Drivers/Gd/ColorProcessorTest.php +++ b/tests/Unit/Drivers/Gd/ColorProcessorTest.php @@ -12,7 +12,11 @@ use Intervention\Image\Drivers\Gd\ColorProcessor; use Intervention\Image\Exceptions\ColorException; use Intervention\Image\Tests\BaseTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\RequiresPhpExtension; +#[RequiresPhpExtension('gd')] +#[CoversClass(ColorProcessor::class)] final class ColorProcessorTest extends BaseTestCase { public function testColorToNative(): void diff --git a/tests/Unit/Drivers/Gd/CoreTest.php b/tests/Unit/Drivers/Gd/CoreTest.php index c6cfb73a7..1c30f02c4 100644 --- a/tests/Unit/Drivers/Gd/CoreTest.php +++ b/tests/Unit/Drivers/Gd/CoreTest.php @@ -9,7 +9,11 @@ use Intervention\Image\Drivers\Gd\Frame; use Intervention\Image\Exceptions\AnimationException; use Intervention\Image\Tests\BaseTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\RequiresPhpExtension; +#[RequiresPhpExtension('gd')] +#[CoversClass(Core::class)] final class CoreTest extends BaseTestCase { protected Core $core; diff --git a/tests/Unit/Drivers/Gd/Decoders/AbstractDecoderTest.php b/tests/Unit/Drivers/Gd/Decoders/AbstractDecoderTest.php index 03ecf5d4d..cfec3481d 100644 --- a/tests/Unit/Drivers/Gd/Decoders/AbstractDecoderTest.php +++ b/tests/Unit/Drivers/Gd/Decoders/AbstractDecoderTest.php @@ -8,7 +8,11 @@ use Intervention\Image\MediaType; use Intervention\Image\Tests\BaseTestCase; use Mockery; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\RequiresPhpExtension; +#[RequiresPhpExtension('gd')] +#[CoversClass(AbstractDecoder::class)] final class AbstractDecoderTest extends BaseTestCase { public function testGetMediaTypeFromFilePath(): void diff --git a/tests/Unit/Drivers/Gd/Decoders/Base64ImageDecoderTest.php b/tests/Unit/Drivers/Gd/Decoders/Base64ImageDecoderTest.php index ff1bcc816..a8743fe4d 100644 --- a/tests/Unit/Drivers/Gd/Decoders/Base64ImageDecoderTest.php +++ b/tests/Unit/Drivers/Gd/Decoders/Base64ImageDecoderTest.php @@ -13,7 +13,7 @@ use Intervention\Image\Tests\BaseTestCase; #[RequiresPhpExtension('gd')] -#[CoversClass(\Intervention\Image\Drivers\Gd\Decoders\Base64ImageDecoder::class)] +#[CoversClass(Base64ImageDecoder::class)] final class Base64ImageDecoderTest extends BaseTestCase { protected Base64ImageDecoder $decoder; diff --git a/tests/Unit/Drivers/Gd/Decoders/BinaryImageDecoderTest.php b/tests/Unit/Drivers/Gd/Decoders/BinaryImageDecoderTest.php index f7309f40a..303191ba9 100644 --- a/tests/Unit/Drivers/Gd/Decoders/BinaryImageDecoderTest.php +++ b/tests/Unit/Drivers/Gd/Decoders/BinaryImageDecoderTest.php @@ -12,7 +12,7 @@ use Intervention\Image\Tests\BaseTestCase; #[RequiresPhpExtension('gd')] -#[CoversClass(\Intervention\Image\Drivers\Gd\Decoders\BinaryImageDecoder::class)] +#[CoversClass(BinaryImageDecoder::class)] final class BinaryImageDecoderTest extends BaseTestCase { protected BinaryImageDecoder $decoder; diff --git a/tests/Unit/Drivers/Gd/Decoders/DataUriImageDecoderTest.php b/tests/Unit/Drivers/Gd/Decoders/DataUriImageDecoderTest.php index 8c2f604e7..691bdd496 100644 --- a/tests/Unit/Drivers/Gd/Decoders/DataUriImageDecoderTest.php +++ b/tests/Unit/Drivers/Gd/Decoders/DataUriImageDecoderTest.php @@ -14,7 +14,7 @@ use stdClass; #[RequiresPhpExtension('gd')] -#[CoversClass(\Intervention\Image\Drivers\Gd\Decoders\DataUriImageDecoder::class)] +#[CoversClass(DataUriImageDecoder::class)] final class DataUriImageDecoderTest extends BaseTestCase { protected DataUriImageDecoder $decoder; diff --git a/tests/Unit/Drivers/Gd/Decoders/FilePathImageDecoderTest.php b/tests/Unit/Drivers/Gd/Decoders/FilePathImageDecoderTest.php index e17ebf467..4b0e47cb9 100644 --- a/tests/Unit/Drivers/Gd/Decoders/FilePathImageDecoderTest.php +++ b/tests/Unit/Drivers/Gd/Decoders/FilePathImageDecoderTest.php @@ -15,7 +15,7 @@ use PHPUnit\Framework\Attributes\DataProvider; #[RequiresPhpExtension('gd')] -#[CoversClass(\Intervention\Image\Drivers\Gd\Decoders\FilePathImageDecoder::class)] +#[CoversClass(FilePathImageDecoder::class)] final class FilePathImageDecoderTest extends BaseTestCase { protected FilePathImageDecoder $decoder; diff --git a/tests/Unit/Drivers/Gd/Decoders/FilePointerImageDecoderTest.php b/tests/Unit/Drivers/Gd/Decoders/FilePointerImageDecoderTest.php index e40777efc..ee7a4f3df 100644 --- a/tests/Unit/Drivers/Gd/Decoders/FilePointerImageDecoderTest.php +++ b/tests/Unit/Drivers/Gd/Decoders/FilePointerImageDecoderTest.php @@ -12,7 +12,7 @@ use Intervention\Image\Tests\GdTestCase; #[RequiresPhpExtension('gd')] -#[CoversClass(\Intervention\Image\Drivers\Gd\Decoders\FilePointerImageDecoder::class)] +#[CoversClass(FilePointerImageDecoder::class)] final class FilePointerImageDecoderTest extends GdTestCase { public function testDecode(): void diff --git a/tests/Unit/Drivers/Gd/Decoders/ImageObjectDecoderTest.php b/tests/Unit/Drivers/Gd/Decoders/ImageObjectDecoderTest.php index 2f8cbcd6a..cc67155c0 100644 --- a/tests/Unit/Drivers/Gd/Decoders/ImageObjectDecoderTest.php +++ b/tests/Unit/Drivers/Gd/Decoders/ImageObjectDecoderTest.php @@ -11,7 +11,7 @@ use Intervention\Image\Tests\GdTestCase; #[RequiresPhpExtension('gd')] -#[CoversClass(\Intervention\Image\Decoders\ImageObjectDecoder::class)] +#[CoversClass(ImageObjectDecoder::class)] final class ImageObjectDecoderTest extends GdTestCase { public function testDecode(): void diff --git a/tests/Unit/Drivers/Gd/Decoders/SplFileInfoImageDecoderTest.php b/tests/Unit/Drivers/Gd/Decoders/SplFileInfoImageDecoderTest.php index d0a5617e3..11d6c30ad 100644 --- a/tests/Unit/Drivers/Gd/Decoders/SplFileInfoImageDecoderTest.php +++ b/tests/Unit/Drivers/Gd/Decoders/SplFileInfoImageDecoderTest.php @@ -13,7 +13,7 @@ use SplFileInfo; #[RequiresPhpExtension('gd')] -#[CoversClass(\Intervention\Image\Drivers\Gd\Decoders\SplFileInfoImageDecoder::class)] +#[CoversClass(SplFileInfoImageDecoder::class)] final class SplFileInfoImageDecoderTest extends BaseTestCase { public function testDecode(): void diff --git a/tests/Unit/Drivers/Gd/DriverTest.php b/tests/Unit/Drivers/Gd/DriverTest.php index 989e3cad2..ce009584b 100644 --- a/tests/Unit/Drivers/Gd/DriverTest.php +++ b/tests/Unit/Drivers/Gd/DriverTest.php @@ -15,8 +15,12 @@ use Intervention\Image\Interfaces\ImageInterface; use Intervention\Image\MediaType; use Intervention\Image\Tests\BaseTestCase; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\RequiresPhpExtension; +#[RequiresPhpExtension('gd')] +#[CoversClass(Driver::class)] final class DriverTest extends BaseTestCase { protected Driver $driver; diff --git a/tests/Unit/Drivers/Gd/Encoders/AvifEncoderTest.php b/tests/Unit/Drivers/Gd/Encoders/AvifEncoderTest.php index 1419d54c5..6bc109fbb 100644 --- a/tests/Unit/Drivers/Gd/Encoders/AvifEncoderTest.php +++ b/tests/Unit/Drivers/Gd/Encoders/AvifEncoderTest.php @@ -4,14 +4,13 @@ namespace Intervention\Image\Tests\Unit\Drivers\Gd\Encoders; +use Intervention\Image\Drivers\Gd\Encoders\AvifEncoder; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\RequiresPhpExtension; -use Intervention\Image\Encoders\AvifEncoder; use Intervention\Image\Tests\GdTestCase; #[RequiresPhpExtension('gd')] -#[CoversClass(\Intervention\Image\Encoders\AvifEncoder::class)] -#[CoversClass(\Intervention\Image\Drivers\Gd\Encoders\AvifEncoder::class)] +#[CoversClass(AvifEncoder::class)] final class AvifEncoderTest extends GdTestCase { public function testEncode(): void diff --git a/tests/Unit/Drivers/Gd/Encoders/BmpEncoderTest.php b/tests/Unit/Drivers/Gd/Encoders/BmpEncoderTest.php index 25a0d6387..39f2659de 100644 --- a/tests/Unit/Drivers/Gd/Encoders/BmpEncoderTest.php +++ b/tests/Unit/Drivers/Gd/Encoders/BmpEncoderTest.php @@ -4,14 +4,13 @@ namespace Intervention\Image\Tests\Unit\Drivers\Gd\Encoders; +use Intervention\Image\Drivers\Gd\Encoders\BmpEncoder; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\RequiresPhpExtension; -use Intervention\Image\Encoders\BmpEncoder; use Intervention\Image\Tests\GdTestCase; #[RequiresPhpExtension('gd')] -#[CoversClass(\Intervention\Image\Encoders\BmpEncoder::class)] -#[CoversClass(\Intervention\Image\Drivers\Gd\Encoders\BmpEncoder::class)] +#[CoversClass(BmpEncoder::class)] final class BmpEncoderTest extends GdTestCase { public function testEncode(): void diff --git a/tests/Unit/Drivers/Gd/Encoders/GifEncoderTest.php b/tests/Unit/Drivers/Gd/Encoders/GifEncoderTest.php index 6a87d7c53..6a9508595 100644 --- a/tests/Unit/Drivers/Gd/Encoders/GifEncoderTest.php +++ b/tests/Unit/Drivers/Gd/Encoders/GifEncoderTest.php @@ -5,14 +5,13 @@ namespace Intervention\Image\Tests\Unit\Drivers\Gd\Encoders; use Intervention\Gif\Decoder; +use Intervention\Image\Drivers\Gd\Encoders\GifEncoder; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\RequiresPhpExtension; -use Intervention\Image\Encoders\GifEncoder; use Intervention\Image\Tests\GdTestCase; #[RequiresPhpExtension('gd')] -#[CoversClass(\Intervention\Image\Encoders\GifEncoder::class)] -#[CoversClass(\Intervention\Image\Drivers\Gd\Encoders\GifEncoder::class)] +#[CoversClass(GifEncoder::class)] final class GifEncoderTest extends GdTestCase { public function testEncode(): void diff --git a/tests/Unit/Drivers/Gd/Encoders/JpegEncoderTest.php b/tests/Unit/Drivers/Gd/Encoders/JpegEncoderTest.php index 5e29fcc86..14d0c33e0 100644 --- a/tests/Unit/Drivers/Gd/Encoders/JpegEncoderTest.php +++ b/tests/Unit/Drivers/Gd/Encoders/JpegEncoderTest.php @@ -4,15 +4,15 @@ namespace Intervention\Image\Tests\Unit\Drivers\Gd\Encoders; +use Intervention\Image\Drivers\Gd\Driver; +use Intervention\Image\Drivers\Gd\Encoders\JpegEncoder; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\RequiresPhpExtension; -use Intervention\Image\Encoders\JpegEncoder; use Intervention\Image\Tests\GdTestCase; use Intervention\Image\Tests\Traits\CanDetectProgressiveJpeg; #[RequiresPhpExtension('gd')] -#[CoversClass(\Intervention\Image\Encoders\JpegEncoder::class)] -#[CoversClass(\Intervention\Image\Drivers\Gd\Encoders\JpegEncoder::class)] +#[CoversClass(JpegEncoder::class)] final class JpegEncoderTest extends GdTestCase { use CanDetectProgressiveJpeg; @@ -21,6 +21,7 @@ public function testEncode(): void { $image = $this->createTestImage(3, 2); $encoder = new JpegEncoder(75); + $encoder->setDriver(new Driver()); $result = $encoder->encode($image); $this->assertMediaType('image/jpeg', $result); $this->assertEquals('image/jpeg', $result->mimetype()); @@ -30,6 +31,7 @@ public function testEncodeProgressive(): void { $image = $this->createTestImage(3, 2); $encoder = new JpegEncoder(progressive: true); + $encoder->setDriver(new Driver()); $result = $encoder->encode($image); $this->assertMediaType('image/jpeg', $result); $this->assertEquals('image/jpeg', $result->mimetype()); diff --git a/tests/Unit/Drivers/Gd/Encoders/PngEncoderTest.php b/tests/Unit/Drivers/Gd/Encoders/PngEncoderTest.php index b658696ea..003bcb384 100644 --- a/tests/Unit/Drivers/Gd/Encoders/PngEncoderTest.php +++ b/tests/Unit/Drivers/Gd/Encoders/PngEncoderTest.php @@ -5,17 +5,16 @@ namespace Intervention\Image\Tests\Unit\Drivers\Gd\Encoders; use Generator; +use Intervention\Image\Drivers\Gd\Encoders\PngEncoder; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\RequiresPhpExtension; -use Intervention\Image\Encoders\PngEncoder; use Intervention\Image\Interfaces\ImageInterface; use Intervention\Image\Tests\GdTestCase; use Intervention\Image\Tests\Traits\CanInspectPngFormat; use PHPUnit\Framework\Attributes\DataProvider; #[RequiresPhpExtension('gd')] -#[CoversClass(\Intervention\Image\Encoders\PngEncoder::class)] -#[CoversClass(\Intervention\Image\Drivers\Gd\Encoders\PngEncoder::class)] +#[CoversClass(PngEncoder::class)] final class PngEncoderTest extends GdTestCase { use CanInspectPngFormat; diff --git a/tests/Unit/Drivers/Gd/Encoders/WebpEncoderTest.php b/tests/Unit/Drivers/Gd/Encoders/WebpEncoderTest.php index c65a12faa..4878a5de3 100644 --- a/tests/Unit/Drivers/Gd/Encoders/WebpEncoderTest.php +++ b/tests/Unit/Drivers/Gd/Encoders/WebpEncoderTest.php @@ -4,14 +4,13 @@ namespace Intervention\Image\Tests\Unit\Drivers\Gd\Encoders; +use Intervention\Image\Drivers\Gd\Encoders\WebpEncoder; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\RequiresPhpExtension; -use Intervention\Image\Encoders\WebpEncoder; use Intervention\Image\Tests\GdTestCase; #[RequiresPhpExtension('gd')] -#[CoversClass(\Intervention\Image\Encoders\WebpEncoder::class)] -#[CoversClass(\Intervention\Image\Drivers\Gd\Encoders\WebpEncoder::class)] +#[CoversClass(WebpEncoder::class)] final class WebpEncoderTest extends GdTestCase { public function testEncode(): void diff --git a/tests/Unit/Drivers/Gd/FontProcessorTest.php b/tests/Unit/Drivers/Gd/FontProcessorTest.php index f098f10a1..c4c90a9da 100644 --- a/tests/Unit/Drivers/Gd/FontProcessorTest.php +++ b/tests/Unit/Drivers/Gd/FontProcessorTest.php @@ -10,7 +10,11 @@ use Intervention\Image\Tests\BaseTestCase; use Intervention\Image\Typography\Font; use Intervention\Image\Typography\TextBlock; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\RequiresPhpExtension; +#[RequiresPhpExtension('gd')] +#[CoversClass(FontProcessor::class)] final class FontProcessorTest extends BaseTestCase { public function testBoxSizeGdOne(): void diff --git a/tests/Unit/Drivers/Gd/FrameTest.php b/tests/Unit/Drivers/Gd/FrameTest.php index d63210efe..ba7ae15f1 100644 --- a/tests/Unit/Drivers/Gd/FrameTest.php +++ b/tests/Unit/Drivers/Gd/FrameTest.php @@ -14,7 +14,7 @@ use Intervention\Image\Tests\BaseTestCase; #[RequiresPhpExtension('gd')] -#[CoversClass(\Intervention\Image\Drivers\Gd\Frame::class)] +#[CoversClass(Frame::class)] final class FrameTest extends BaseTestCase { protected function getTestFrame(): Frame diff --git a/tests/Unit/Drivers/Gd/ImageTest.php b/tests/Unit/Drivers/Gd/ImageTest.php index 83c762830..14e17f440 100644 --- a/tests/Unit/Drivers/Gd/ImageTest.php +++ b/tests/Unit/Drivers/Gd/ImageTest.php @@ -25,7 +25,11 @@ use Intervention\Image\Modifiers\GreyscaleModifier; use Intervention\Image\Tests\GdTestCase; use Intervention\Image\Typography\Font; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\RequiresPhpExtension; +#[RequiresPhpExtension('gd')] +#[CoversClass(Image::class)] final class ImageTest extends GdTestCase { protected Image $image; diff --git a/tests/Unit/Drivers/Imagick/Analyzers/ColorspaceAnalyzerTest.php b/tests/Unit/Drivers/Imagick/Analyzers/ColorspaceAnalyzerTest.php index ba90b8b45..19f7e5dc9 100644 --- a/tests/Unit/Drivers/Imagick/Analyzers/ColorspaceAnalyzerTest.php +++ b/tests/Unit/Drivers/Imagick/Analyzers/ColorspaceAnalyzerTest.php @@ -4,21 +4,22 @@ namespace Intervention\Image\Tests\Unit\Drivers\Imagick\Analyzers; +use Intervention\Image\Drivers\Imagick\Analyzers\ColorspaceAnalyzer; +use Intervention\Image\Drivers\Imagick\Driver; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\RequiresPhpExtension; -use Intervention\Image\Analyzers\ColorspaceAnalyzer; use Intervention\Image\Interfaces\ColorspaceInterface; use Intervention\Image\Tests\ImagickTestCase; #[RequiresPhpExtension('imagick')] -#[CoversClass(\Intervention\Image\Analyzers\ColorspaceAnalyzer::class)] -#[CoversClass(\Intervention\Image\Drivers\Imagick\Analyzers\ColorspaceAnalyzer::class)] +#[CoversClass(ColorspaceAnalyzer::class)] final class ColorspaceAnalyzerTest extends ImagickTestCase { public function testAnalyze(): void { $image = $this->readTestImage('tile.png'); $analyzer = new ColorspaceAnalyzer(); + $analyzer->setDriver(new Driver()); $result = $analyzer->analyze($image); $this->assertInstanceOf(ColorspaceInterface::class, $result); } diff --git a/tests/Unit/Drivers/Imagick/Analyzers/HeightAnalyzerTest.php b/tests/Unit/Drivers/Imagick/Analyzers/HeightAnalyzerTest.php index ab1e3125a..f42962165 100644 --- a/tests/Unit/Drivers/Imagick/Analyzers/HeightAnalyzerTest.php +++ b/tests/Unit/Drivers/Imagick/Analyzers/HeightAnalyzerTest.php @@ -4,20 +4,21 @@ namespace Intervention\Image\Tests\Unit\Drivers\Imagick\Analyzers; +use Intervention\Image\Drivers\Imagick\Analyzers\HeightAnalyzer; +use Intervention\Image\Drivers\Imagick\Driver; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\RequiresPhpExtension; -use Intervention\Image\Analyzers\HeightAnalyzer; use Intervention\Image\Tests\ImagickTestCase; #[RequiresPhpExtension('imagick')] -#[CoversClass(\Intervention\Image\Analyzers\HeightAnalyzer::class)] -#[CoversClass(\Intervention\Image\Drivers\Imagick\Analyzers\HeightAnalyzer::class)] +#[CoversClass(HeightAnalyzer::class)] final class HeightAnalyzerTest extends ImagickTestCase { public function testAnalyze(): void { $image = $this->readTestImage('tile.png'); $analyzer = new HeightAnalyzer(); + $analyzer->setDriver(new Driver()); $result = $analyzer->analyze($image); $this->assertEquals(16, $result); } diff --git a/tests/Unit/Drivers/Imagick/Analyzers/PixelColorAnalyzerTest.php b/tests/Unit/Drivers/Imagick/Analyzers/PixelColorAnalyzerTest.php index 0a5776298..10ea90608 100644 --- a/tests/Unit/Drivers/Imagick/Analyzers/PixelColorAnalyzerTest.php +++ b/tests/Unit/Drivers/Imagick/Analyzers/PixelColorAnalyzerTest.php @@ -4,21 +4,22 @@ namespace Intervention\Image\Tests\Unit\Drivers\Imagick\Analyzers; +use Intervention\Image\Drivers\Imagick\Analyzers\PixelColorAnalyzer; +use Intervention\Image\Drivers\Imagick\Driver; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\RequiresPhpExtension; -use Intervention\Image\Analyzers\PixelColorAnalyzer; use Intervention\Image\Interfaces\ColorInterface; use Intervention\Image\Tests\ImagickTestCase; #[RequiresPhpExtension('imagick')] -#[CoversClass(\Intervention\Image\Analyzers\PixelColorAnalyzer::class)] -#[CoversClass(\Intervention\Image\Drivers\Imagick\Analyzers\PixelColorAnalyzer::class)] +#[CoversClass(PixelColorAnalyzer::class)] final class PixelColorAnalyzerTest extends ImagickTestCase { public function testAnalyze(): void { $image = $this->readTestImage('tile.png'); $analyzer = new PixelColorAnalyzer(0, 0); + $analyzer->setDriver(new Driver()); $result = $analyzer->analyze($image); $this->assertInstanceOf(ColorInterface::class, $result); $this->assertEquals('b4e000', $result->toHex()); diff --git a/tests/Unit/Drivers/Imagick/Analyzers/PixelColorsAnalyzerTest.php b/tests/Unit/Drivers/Imagick/Analyzers/PixelColorsAnalyzerTest.php index c1651bef6..f28d9621a 100644 --- a/tests/Unit/Drivers/Imagick/Analyzers/PixelColorsAnalyzerTest.php +++ b/tests/Unit/Drivers/Imagick/Analyzers/PixelColorsAnalyzerTest.php @@ -6,20 +6,21 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\RequiresPhpExtension; -use Intervention\Image\Analyzers\PixelColorsAnalyzer; use Intervention\Image\Collection; +use Intervention\Image\Drivers\Imagick\Analyzers\PixelColorsAnalyzer; +use Intervention\Image\Drivers\Imagick\Driver; use Intervention\Image\Interfaces\ColorInterface; use Intervention\Image\Tests\ImagickTestCase; #[RequiresPhpExtension('imagick')] -#[CoversClass(\Intervention\Image\Analyzers\PixelColorsAnalyzer::class)] -#[CoversClass(\Intervention\Image\Drivers\Imagick\Analyzers\PixelColorsAnalyzer::class)] +#[CoversClass(PixelColorsAnalyzer::class)] final class PixelColorsAnalyzerTest extends ImagickTestCase { public function testAnalyze(): void { $image = $this->readTestImage('tile.png'); $analyzer = new PixelColorsAnalyzer(0, 0); + $analyzer->setDriver(new Driver()); $result = $analyzer->analyze($image); $this->assertInstanceOf(Collection::class, $result); $this->assertInstanceOf(ColorInterface::class, $result->first()); diff --git a/tests/Unit/Drivers/Imagick/Analyzers/ProfileAnalyzerTest.php b/tests/Unit/Drivers/Imagick/Analyzers/ProfileAnalyzerTest.php index f68e87a85..b2240e3c7 100644 --- a/tests/Unit/Drivers/Imagick/Analyzers/ProfileAnalyzerTest.php +++ b/tests/Unit/Drivers/Imagick/Analyzers/ProfileAnalyzerTest.php @@ -4,21 +4,22 @@ namespace Intervention\Image\Tests\Unit\Drivers\Imagick\Analyzers; +use Intervention\Image\Drivers\Imagick\Analyzers\ProfileAnalyzer; +use Intervention\Image\Drivers\Imagick\Driver; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\RequiresPhpExtension; -use Intervention\Image\Analyzers\ProfileAnalyzer; use Intervention\Image\Exceptions\ColorException; use Intervention\Image\Tests\ImagickTestCase; #[RequiresPhpExtension('imagick')] -#[CoversClass(\Intervention\Image\Analyzers\ProfileAnalyzer::class)] -#[CoversClass(\Intervention\Image\Drivers\Imagick\Analyzers\ProfileAnalyzer::class)] +#[CoversClass(ProfileAnalyzer::class)] final class ProfileAnalyzerTest extends ImagickTestCase { public function testAnalyze(): void { $image = $this->readTestImage('tile.png'); $analyzer = new ProfileAnalyzer(); + $analyzer->setDriver(new Driver()); $this->expectException(ColorException::class); $analyzer->analyze($image); } diff --git a/tests/Unit/Drivers/Imagick/Analyzers/ResolutionAnalyzerTest.php b/tests/Unit/Drivers/Imagick/Analyzers/ResolutionAnalyzerTest.php index 363fbbdb7..c811062f4 100644 --- a/tests/Unit/Drivers/Imagick/Analyzers/ResolutionAnalyzerTest.php +++ b/tests/Unit/Drivers/Imagick/Analyzers/ResolutionAnalyzerTest.php @@ -4,21 +4,22 @@ namespace Intervention\Image\Tests\Unit\Drivers\Imagick\Analyzers; +use Intervention\Image\Drivers\Imagick\Analyzers\ResolutionAnalyzer; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\RequiresPhpExtension; -use Intervention\Image\Analyzers\ResolutionAnalyzer; +use Intervention\Image\Drivers\Imagick\Driver; use Intervention\Image\Resolution; use Intervention\Image\Tests\ImagickTestCase; #[RequiresPhpExtension('imagick')] -#[CoversClass(\Intervention\Image\Analyzers\ResolutionAnalyzer::class)] -#[CoversClass(\Intervention\Image\Drivers\Imagick\Analyzers\ResolutionAnalyzer::class)] +#[CoversClass(ResolutionAnalyzer::class)] final class ResolutionAnalyzerTest extends ImagickTestCase { public function testAnalyze(): void { $image = $this->readTestImage('tile.png'); $analyzer = new ResolutionAnalyzer(); + $analyzer->setDriver(new Driver()); $result = $analyzer->analyze($image); $this->assertInstanceOf(Resolution::class, $result); } diff --git a/tests/Unit/Drivers/Imagick/Analyzers/WidthAnalyzerTest.php b/tests/Unit/Drivers/Imagick/Analyzers/WidthAnalyzerTest.php index acfecf533..a222028a3 100644 --- a/tests/Unit/Drivers/Imagick/Analyzers/WidthAnalyzerTest.php +++ b/tests/Unit/Drivers/Imagick/Analyzers/WidthAnalyzerTest.php @@ -4,20 +4,21 @@ namespace Intervention\Image\Tests\Unit\Drivers\Imagick\Analyzers; +use Intervention\Image\Drivers\Imagick\Analyzers\WidthAnalyzer; +use Intervention\Image\Drivers\Imagick\Driver; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\RequiresPhpExtension; -use Intervention\Image\Analyzers\WidthAnalyzer; use Intervention\Image\Tests\ImagickTestCase; #[RequiresPhpExtension('imagick')] -#[CoversClass(\Intervention\Image\Analyzers\WidthAnalyzer::class)] -#[CoversClass(\Intervention\Image\Drivers\Imagick\Analyzers\WidthAnalyzer::class)] +#[CoversClass(WidthAnalyzer::class)] final class WidthAnalyzerTest extends ImagickTestCase { public function testAnalyze(): void { $image = $this->readTestImage('tile.png'); $analyzer = new WidthAnalyzer(); + $analyzer->setDriver(new Driver()); $result = $analyzer->analyze($image); $this->assertEquals(16, $result); } diff --git a/tests/Unit/Drivers/Imagick/ColorProcessorTest.php b/tests/Unit/Drivers/Imagick/ColorProcessorTest.php index 55164ae95..89c5224fd 100644 --- a/tests/Unit/Drivers/Imagick/ColorProcessorTest.php +++ b/tests/Unit/Drivers/Imagick/ColorProcessorTest.php @@ -9,7 +9,11 @@ use Intervention\Image\Colors\Rgb\Colorspace; use Intervention\Image\Drivers\Imagick\ColorProcessor; use Intervention\Image\Tests\BaseTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\RequiresPhpExtension; +#[RequiresPhpExtension('imagick')] +#[CoversClass(ColorProcessor::class)] final class ColorProcessorTest extends BaseTestCase { public function testColorToNative(): void diff --git a/tests/Unit/Drivers/Imagick/CoreTest.php b/tests/Unit/Drivers/Imagick/CoreTest.php index 1a6fa89a3..3376ecc7c 100644 --- a/tests/Unit/Drivers/Imagick/CoreTest.php +++ b/tests/Unit/Drivers/Imagick/CoreTest.php @@ -10,7 +10,11 @@ use Intervention\Image\Drivers\Imagick\Frame; use Intervention\Image\Exceptions\AnimationException; use Intervention\Image\Tests\BaseTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\RequiresPhpExtension; +#[RequiresPhpExtension('imagick')] +#[CoversClass(Core::class)] final class CoreTest extends BaseTestCase { protected Core $core; diff --git a/tests/Unit/Drivers/Imagick/Decoders/Base64ImageDecoderTest.php b/tests/Unit/Drivers/Imagick/Decoders/Base64ImageDecoderTest.php index d4f622ebf..6ba10f572 100644 --- a/tests/Unit/Drivers/Imagick/Decoders/Base64ImageDecoderTest.php +++ b/tests/Unit/Drivers/Imagick/Decoders/Base64ImageDecoderTest.php @@ -13,7 +13,7 @@ use Intervention\Image\Tests\BaseTestCase; #[RequiresPhpExtension('imagick')] -#[CoversClass(\Intervention\Image\Drivers\Imagick\Decoders\Base64ImageDecoder::class)] +#[CoversClass(Base64ImageDecoder::class)] final class Base64ImageDecoderTest extends BaseTestCase { protected Base64ImageDecoder $decoder; diff --git a/tests/Unit/Drivers/Imagick/Decoders/BinaryImageDecoderTest.php b/tests/Unit/Drivers/Imagick/Decoders/BinaryImageDecoderTest.php index 2b2211664..bfc34d3e7 100644 --- a/tests/Unit/Drivers/Imagick/Decoders/BinaryImageDecoderTest.php +++ b/tests/Unit/Drivers/Imagick/Decoders/BinaryImageDecoderTest.php @@ -11,8 +11,12 @@ use Intervention\Image\Exceptions\DecoderException; use Intervention\Image\Image; use Intervention\Image\Tests\BaseTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\RequiresPhpExtension; use stdClass; +#[RequiresPhpExtension('imagick')] +#[CoversClass(BinaryImageDecoder::class)] final class BinaryImageDecoderTest extends BaseTestCase { protected BinaryImageDecoder $decoder; diff --git a/tests/Unit/Drivers/Imagick/Decoders/DataUriImageDecoderTest.php b/tests/Unit/Drivers/Imagick/Decoders/DataUriImageDecoderTest.php index db8de4d56..25004b663 100644 --- a/tests/Unit/Drivers/Imagick/Decoders/DataUriImageDecoderTest.php +++ b/tests/Unit/Drivers/Imagick/Decoders/DataUriImageDecoderTest.php @@ -14,7 +14,7 @@ use stdClass; #[RequiresPhpExtension('imagick')] -#[CoversClass(\Intervention\Image\Drivers\Imagick\Decoders\DataUriImageDecoder::class)] +#[CoversClass(DataUriImageDecoder::class)] final class DataUriImageDecoderTest extends BaseTestCase { protected DataUriImageDecoder $decoder; diff --git a/tests/Unit/Drivers/Imagick/Decoders/FilePathImageDecoderTest.php b/tests/Unit/Drivers/Imagick/Decoders/FilePathImageDecoderTest.php index e9b6c5280..abe46d936 100644 --- a/tests/Unit/Drivers/Imagick/Decoders/FilePathImageDecoderTest.php +++ b/tests/Unit/Drivers/Imagick/Decoders/FilePathImageDecoderTest.php @@ -15,7 +15,7 @@ use PHPUnit\Framework\Attributes\DataProvider; #[RequiresPhpExtension('imagick')] -#[CoversClass(\Intervention\Image\Drivers\Imagick\Decoders\FilePathImageDecoder::class)] +#[CoversClass(FilePathImageDecoder::class)] final class FilePathImageDecoderTest extends BaseTestCase { protected FilePathImageDecoder $decoder; diff --git a/tests/Unit/Drivers/Imagick/Decoders/FilePointerImageDecoderTest.php b/tests/Unit/Drivers/Imagick/Decoders/FilePointerImageDecoderTest.php index 157240141..e2e9cef41 100644 --- a/tests/Unit/Drivers/Imagick/Decoders/FilePointerImageDecoderTest.php +++ b/tests/Unit/Drivers/Imagick/Decoders/FilePointerImageDecoderTest.php @@ -12,7 +12,7 @@ use Intervention\Image\Tests\ImagickTestCase; #[RequiresPhpExtension('imagick')] -#[CoversClass(\Intervention\Image\Drivers\Imagick\Decoders\FilePointerImageDecoder::class)] +#[CoversClass(FilePointerImageDecoder::class)] final class FilePointerImageDecoderTest extends ImagickTestCase { public function testDecode(): void diff --git a/tests/Unit/Drivers/Imagick/Decoders/ImageObjectDecoderTest.php b/tests/Unit/Drivers/Imagick/Decoders/ImageObjectDecoderTest.php index 70efd2b39..c2945d741 100644 --- a/tests/Unit/Drivers/Imagick/Decoders/ImageObjectDecoderTest.php +++ b/tests/Unit/Drivers/Imagick/Decoders/ImageObjectDecoderTest.php @@ -11,7 +11,7 @@ use Intervention\Image\Tests\ImagickTestCase; #[RequiresPhpExtension('imagick')] -#[CoversClass(\Intervention\Image\Decoders\ImageObjectDecoder::class)] +#[CoversClass(ImageObjectDecoder::class)] final class ImageObjectDecoderTest extends ImagickTestCase { public function testDecode(): void diff --git a/tests/Unit/Drivers/Imagick/Decoders/SplFileInfoImageDecoderTest.php b/tests/Unit/Drivers/Imagick/Decoders/SplFileInfoImageDecoderTest.php index c4c26c864..1e6231ee0 100644 --- a/tests/Unit/Drivers/Imagick/Decoders/SplFileInfoImageDecoderTest.php +++ b/tests/Unit/Drivers/Imagick/Decoders/SplFileInfoImageDecoderTest.php @@ -13,7 +13,7 @@ use SplFileInfo; #[RequiresPhpExtension('imagick')] -#[CoversClass(\Intervention\Image\Drivers\Imagick\Decoders\SplFileInfoImageDecoder::class)] +#[CoversClass(SplFileInfoImageDecoder::class)] final class SplFileInfoImageDecoderTest extends BaseTestCase { public function testDecode(): void diff --git a/tests/Unit/Drivers/Imagick/DriverTest.php b/tests/Unit/Drivers/Imagick/DriverTest.php index 58d59d980..c94658329 100644 --- a/tests/Unit/Drivers/Imagick/DriverTest.php +++ b/tests/Unit/Drivers/Imagick/DriverTest.php @@ -15,8 +15,12 @@ use Intervention\Image\Interfaces\ImageInterface; use Intervention\Image\MediaType; use Intervention\Image\Tests\BaseTestCase; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\RequiresPhpExtension; +#[RequiresPhpExtension('imagick')] +#[CoversClass(Driver::class)] final class DriverTest extends BaseTestCase { protected Driver $driver; diff --git a/tests/Unit/Drivers/Imagick/Encoders/AvifEncoderTest.php b/tests/Unit/Drivers/Imagick/Encoders/AvifEncoderTest.php index b425a2f3b..59acc267e 100644 --- a/tests/Unit/Drivers/Imagick/Encoders/AvifEncoderTest.php +++ b/tests/Unit/Drivers/Imagick/Encoders/AvifEncoderTest.php @@ -4,14 +4,13 @@ namespace Intervention\Image\Tests\Unit\Drivers\Imagick\Encoders; +use Intervention\Image\Drivers\Imagick\Encoders\AvifEncoder; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\RequiresPhpExtension; -use Intervention\Image\Encoders\AvifEncoder; use Intervention\Image\Tests\ImagickTestCase; #[RequiresPhpExtension('imagick')] -#[CoversClass(\Intervention\Image\Encoders\AvifEncoder::class)] -#[CoversClass(\Intervention\Image\Drivers\Imagick\Encoders\AvifEncoder::class)] +#[CoversClass(AvifEncoder::class)] final class AvifEncoderTest extends ImagickTestCase { public function testEncode(): void diff --git a/tests/Unit/Drivers/Imagick/Encoders/BmpEncoderTest.php b/tests/Unit/Drivers/Imagick/Encoders/BmpEncoderTest.php index 2ac9f9624..888b7d5c4 100644 --- a/tests/Unit/Drivers/Imagick/Encoders/BmpEncoderTest.php +++ b/tests/Unit/Drivers/Imagick/Encoders/BmpEncoderTest.php @@ -4,14 +4,13 @@ namespace Intervention\Image\Tests\Unit\Drivers\Imagick\Encoders; +use Intervention\Image\Drivers\Imagick\Encoders\BmpEncoder; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\RequiresPhpExtension; -use Intervention\Image\Encoders\BmpEncoder; use Intervention\Image\Tests\ImagickTestCase; #[RequiresPhpExtension('imagick')] -#[CoversClass(\Intervention\Image\Encoders\BmpEncoder::class)] -#[CoversClass(\Intervention\Image\Drivers\Imagick\Encoders\BmpEncoder::class)] +#[CoversClass(BmpEncoder::class)] final class BmpEncoderTest extends ImagickTestCase { public function testEncode(): void diff --git a/tests/Unit/Drivers/Imagick/Encoders/GifEncoderTest.php b/tests/Unit/Drivers/Imagick/Encoders/GifEncoderTest.php index 7085f95b0..98a8bf5ea 100644 --- a/tests/Unit/Drivers/Imagick/Encoders/GifEncoderTest.php +++ b/tests/Unit/Drivers/Imagick/Encoders/GifEncoderTest.php @@ -5,14 +5,13 @@ namespace Intervention\Image\Tests\Unit\Drivers\Imagick\Encoders; use Intervention\Gif\Decoder; +use Intervention\Image\Drivers\Imagick\Encoders\GifEncoder; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\RequiresPhpExtension; -use Intervention\Image\Encoders\GifEncoder; use Intervention\Image\Tests\ImagickTestCase; #[RequiresPhpExtension('imagick')] -#[CoversClass(\Intervention\Image\Encoders\GifEncoder::class)] -#[CoversClass(\Intervention\Image\Drivers\Imagick\Encoders\GifEncoder::class)] +#[CoversClass(GifEncoder::class)] final class GifEncoderTest extends ImagickTestCase { public function testEncode(): void diff --git a/tests/Unit/Drivers/Imagick/Encoders/HeicEncoderTest.php b/tests/Unit/Drivers/Imagick/Encoders/HeicEncoderTest.php index b3843dadb..31ff38361 100644 --- a/tests/Unit/Drivers/Imagick/Encoders/HeicEncoderTest.php +++ b/tests/Unit/Drivers/Imagick/Encoders/HeicEncoderTest.php @@ -4,14 +4,13 @@ namespace Intervention\Image\Tests\Unit\Drivers\Imagick\Encoders; +use Intervention\Image\Drivers\Imagick\Encoders\HeicEncoder; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\RequiresPhpExtension; -use Intervention\Image\Encoders\HeicEncoder; use Intervention\Image\Tests\ImagickTestCase; #[RequiresPhpExtension('imagick')] -#[CoversClass(\Intervention\Image\Encoders\HeicEncoder::class)] -#[CoversClass(\Intervention\Image\Drivers\Imagick\Encoders\HeicEncoder::class)] +#[CoversClass(HeicEncoder::class)] final class HeicEncoderTest extends ImagickTestCase { public function testEncode(): void diff --git a/tests/Unit/Drivers/Imagick/Encoders/Jpeg2000EncoderTest.php b/tests/Unit/Drivers/Imagick/Encoders/Jpeg2000EncoderTest.php index 689604a45..c9e4d0b85 100644 --- a/tests/Unit/Drivers/Imagick/Encoders/Jpeg2000EncoderTest.php +++ b/tests/Unit/Drivers/Imagick/Encoders/Jpeg2000EncoderTest.php @@ -4,14 +4,13 @@ namespace Intervention\Image\Tests\Unit\Drivers\Imagick\Encoders; +use Intervention\Image\Drivers\Imagick\Encoders\Jpeg2000Encoder; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\RequiresPhpExtension; -use Intervention\Image\Encoders\Jpeg2000Encoder; use Intervention\Image\Tests\ImagickTestCase; #[RequiresPhpExtension('imagick')] -#[CoversClass(\Intervention\Image\Encoders\Jpeg2000Encoder::class)] -#[CoversClass(\Intervention\Image\Drivers\Imagick\Encoders\Jpeg2000Encoder::class)] +#[CoversClass(Jpeg2000Encoder::class)] final class Jpeg2000EncoderTest extends ImagickTestCase { public function testEncode(): void diff --git a/tests/Unit/Drivers/Imagick/Encoders/JpegEncoderTest.php b/tests/Unit/Drivers/Imagick/Encoders/JpegEncoderTest.php index 79285fc6b..7bbb91adf 100644 --- a/tests/Unit/Drivers/Imagick/Encoders/JpegEncoderTest.php +++ b/tests/Unit/Drivers/Imagick/Encoders/JpegEncoderTest.php @@ -4,15 +4,15 @@ namespace Intervention\Image\Tests\Unit\Drivers\Imagick\Encoders; +use Intervention\Image\Drivers\Imagick\Driver; +use Intervention\Image\Drivers\Imagick\Encoders\JpegEncoder; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\RequiresPhpExtension; -use Intervention\Image\Encoders\JpegEncoder; use Intervention\Image\Tests\ImagickTestCase; use Intervention\Image\Tests\Traits\CanDetectProgressiveJpeg; #[RequiresPhpExtension('imagick')] -#[CoversClass(\Intervention\Image\Encoders\JpegEncoder::class)] -#[CoversClass(\Intervention\Image\Drivers\Imagick\Encoders\JpegEncoder::class)] +#[CoversClass(JpegEncoder::class)] final class JpegEncoderTest extends ImagickTestCase { use CanDetectProgressiveJpeg; @@ -21,6 +21,7 @@ public function testEncode(): void { $image = $this->createTestImage(3, 2); $encoder = new JpegEncoder(75); + $encoder->setDriver(new Driver()); $result = $encoder->encode($image); $this->assertMediaType('image/jpeg', $result); $this->assertEquals('image/jpeg', $result->mimetype()); @@ -30,6 +31,7 @@ public function testEncodeProgressive(): void { $image = $this->createTestImage(3, 2); $encoder = new JpegEncoder(progressive: true); + $encoder->setDriver(new Driver()); $result = $encoder->encode($image); $this->assertMediaType('image/jpeg', $result); $this->assertEquals('image/jpeg', $result->mimetype()); diff --git a/tests/Unit/Drivers/Imagick/Encoders/PngEncoderTest.php b/tests/Unit/Drivers/Imagick/Encoders/PngEncoderTest.php index cf237e808..64d99f388 100644 --- a/tests/Unit/Drivers/Imagick/Encoders/PngEncoderTest.php +++ b/tests/Unit/Drivers/Imagick/Encoders/PngEncoderTest.php @@ -5,17 +5,16 @@ namespace Intervention\Image\Tests\Unit\Drivers\Imagick\Encoders; use Generator; +use Intervention\Image\Drivers\Imagick\Encoders\PngEncoder; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\RequiresPhpExtension; -use Intervention\Image\Encoders\PngEncoder; use Intervention\Image\Interfaces\ImageInterface; use Intervention\Image\Tests\ImagickTestCase; use Intervention\Image\Tests\Traits\CanInspectPngFormat; use PHPUnit\Framework\Attributes\DataProvider; #[RequiresPhpExtension('imagick')] -#[CoversClass(\Intervention\Image\Encoders\PngEncoder::class)] -#[CoversClass(\Intervention\Image\Drivers\Imagick\Encoders\PngEncoder::class)] +#[CoversClass(PngEncoder::class)] final class PngEncoderTest extends ImagickTestCase { use CanInspectPngFormat; diff --git a/tests/Unit/Drivers/Imagick/Encoders/TiffEncoderTest.php b/tests/Unit/Drivers/Imagick/Encoders/TiffEncoderTest.php index 25cf769ce..58a5dc4eb 100644 --- a/tests/Unit/Drivers/Imagick/Encoders/TiffEncoderTest.php +++ b/tests/Unit/Drivers/Imagick/Encoders/TiffEncoderTest.php @@ -4,14 +4,13 @@ namespace Intervention\Image\Tests\Unit\Drivers\Imagick\Encoders; +use Intervention\Image\Drivers\Imagick\Encoders\TiffEncoder; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\RequiresPhpExtension; -use Intervention\Image\Encoders\TiffEncoder; use Intervention\Image\Tests\ImagickTestCase; #[RequiresPhpExtension('imagick')] -#[CoversClass(\Intervention\Image\Encoders\TiffEncoder::class)] -#[CoversClass(\Intervention\Image\Drivers\Imagick\Encoders\TiffEncoder::class)] +#[CoversClass(TiffEncoder::class)] final class TiffEncoderTest extends ImagickTestCase { public function testEncode(): void diff --git a/tests/Unit/Drivers/Imagick/Encoders/WebpEncoderTest.php b/tests/Unit/Drivers/Imagick/Encoders/WebpEncoderTest.php index 89f3b39fa..18bf38f26 100644 --- a/tests/Unit/Drivers/Imagick/Encoders/WebpEncoderTest.php +++ b/tests/Unit/Drivers/Imagick/Encoders/WebpEncoderTest.php @@ -4,14 +4,13 @@ namespace Intervention\Image\Tests\Unit\Drivers\Imagick\Encoders; +use Intervention\Image\Drivers\Imagick\Encoders\WebpEncoder; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\RequiresPhpExtension; -use Intervention\Image\Encoders\WebpEncoder; use Intervention\Image\Tests\ImagickTestCase; #[RequiresPhpExtension('imagick')] -#[CoversClass(\Intervention\Image\Encoders\WebpEncoder::class)] -#[CoversClass(\Intervention\Image\Drivers\Imagick\Encoders\WebpEncoder::class)] +#[CoversClass(WebpEncoder::class)] final class WebpEncoderTest extends ImagickTestCase { public function testEncode(): void diff --git a/tests/Unit/Drivers/Imagick/FontProcessorTest.php b/tests/Unit/Drivers/Imagick/FontProcessorTest.php index cb80e97ad..ddbb4f681 100644 --- a/tests/Unit/Drivers/Imagick/FontProcessorTest.php +++ b/tests/Unit/Drivers/Imagick/FontProcessorTest.php @@ -10,7 +10,11 @@ use Intervention\Image\Tests\BaseTestCase; use Intervention\Image\Typography\Font; use Intervention\Image\Typography\TextBlock; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\RequiresPhpExtension; +#[RequiresPhpExtension('imagick')] +#[CoversClass(FontProcessor::class)] final class FontProcessorTest extends BaseTestCase { public function testBoxSizeTtf(): void diff --git a/tests/Unit/Drivers/Imagick/FrameTest.php b/tests/Unit/Drivers/Imagick/FrameTest.php index 0654697cb..9ee2a8665 100644 --- a/tests/Unit/Drivers/Imagick/FrameTest.php +++ b/tests/Unit/Drivers/Imagick/FrameTest.php @@ -15,7 +15,7 @@ use Intervention\Image\Tests\BaseTestCase; #[RequiresPhpExtension('imagick')] -#[CoversClass(\Intervention\Image\Drivers\Imagick\Frame::class)] +#[CoversClass(Frame::class)] final class FrameTest extends BaseTestCase { protected function getTestFrame(): Frame diff --git a/tests/Unit/Drivers/Imagick/ImageTest.php b/tests/Unit/Drivers/Imagick/ImageTest.php index 2a83c5604..311bbf5bf 100644 --- a/tests/Unit/Drivers/Imagick/ImageTest.php +++ b/tests/Unit/Drivers/Imagick/ImageTest.php @@ -25,7 +25,11 @@ use Intervention\Image\Modifiers\GreyscaleModifier; use Intervention\Image\Origin; use Intervention\Image\Tests\ImagickTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\RequiresPhpExtension; +#[RequiresPhpExtension('imagick')] +#[CoversClass(Image::class)] final class ImageTest extends ImagickTestCase { protected Image $image; diff --git a/tests/Unit/Drivers/SpecializableAnalyzerTest.php b/tests/Unit/Drivers/SpecializableAnalyzerTest.php index b63457184..052805722 100644 --- a/tests/Unit/Drivers/SpecializableAnalyzerTest.php +++ b/tests/Unit/Drivers/SpecializableAnalyzerTest.php @@ -8,10 +8,12 @@ use Intervention\Image\Interfaces\ImageInterface; use Intervention\Image\Tests\BaseTestCase; use Mockery; +use PHPUnit\Framework\Attributes\CoversClass; +#[CoversClass(SpecializableAnalyzer::class)] final class SpecializableAnalyzerTest extends BaseTestCase { - public function testAnalyzer(): void + public function testAnalyze(): void { $analyzer = Mockery::mock(SpecializableAnalyzer::class)->makePartial(); $image = Mockery::mock(ImageInterface::class); diff --git a/tests/Unit/Drivers/SpecializableDecoderTest.php b/tests/Unit/Drivers/SpecializableDecoderTest.php index a6c5c3b99..b6b1e7e75 100644 --- a/tests/Unit/Drivers/SpecializableDecoderTest.php +++ b/tests/Unit/Drivers/SpecializableDecoderTest.php @@ -8,7 +8,9 @@ use Intervention\Image\Exceptions\DecoderException; use Intervention\Image\Tests\BaseTestCase; use Mockery; +use PHPUnit\Framework\Attributes\CoversClass; +#[CoversClass(SpecializableDecoder::class)] final class SpecializableDecoderTest extends BaseTestCase { public function testDecode(): void diff --git a/tests/Unit/Drivers/SpecializableModifierTest.php b/tests/Unit/Drivers/SpecializableModifierTest.php index bea67973d..d8ddcefb9 100644 --- a/tests/Unit/Drivers/SpecializableModifierTest.php +++ b/tests/Unit/Drivers/SpecializableModifierTest.php @@ -8,7 +8,9 @@ use Intervention\Image\Interfaces\ImageInterface; use Intervention\Image\Tests\BaseTestCase; use Mockery; +use PHPUnit\Framework\Attributes\CoversClass; +#[CoversClass(SpecializableModifier::class)] final class SpecializableModifierTest extends BaseTestCase { public function testApply(): void diff --git a/tests/Unit/EncodedImageTest.php b/tests/Unit/EncodedImageTest.php index 9224d46b8..51fe2bf7c 100644 --- a/tests/Unit/EncodedImageTest.php +++ b/tests/Unit/EncodedImageTest.php @@ -8,7 +8,7 @@ use Intervention\Image\EncodedImage; use Intervention\Image\Tests\BaseTestCase; -#[CoversClass(\Intervention\Image\EncodedImage::class)] +#[CoversClass(EncodedImage::class)] final class EncodedImageTest extends BaseTestCase { public function testConstructor(): void diff --git a/tests/Unit/Encoders/FileExtensionEncoderTest.php b/tests/Unit/Encoders/FileExtensionEncoderTest.php index 429f117b4..ac03cf920 100644 --- a/tests/Unit/Encoders/FileExtensionEncoderTest.php +++ b/tests/Unit/Encoders/FileExtensionEncoderTest.php @@ -19,8 +19,10 @@ use Intervention\Image\FileExtension; use Intervention\Image\Interfaces\EncoderInterface; use Intervention\Image\Tests\BaseTestCase; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; +#[CoversClass(FileExtensionEncoder::class)] final class FileExtensionEncoderTest extends BaseTestCase { private function testEncoder(string|FileExtension $extension, array $options = []): EncoderInterface diff --git a/tests/Unit/Encoders/MediaTypeEncoderTest.php b/tests/Unit/Encoders/MediaTypeEncoderTest.php index 7d779bec5..d78c38e73 100644 --- a/tests/Unit/Encoders/MediaTypeEncoderTest.php +++ b/tests/Unit/Encoders/MediaTypeEncoderTest.php @@ -19,8 +19,10 @@ use Intervention\Image\Interfaces\EncoderInterface; use Intervention\Image\MediaType; use Intervention\Image\Tests\BaseTestCase; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; +#[CoversClass(MediaTypeEncoder::class)] final class MediaTypeEncoderTest extends BaseTestCase { private function testEncoder(string|MediaType $mediaType, array $options = []): EncoderInterface diff --git a/tests/Unit/FileExtensionTest.php b/tests/Unit/FileExtensionTest.php index c5ec92bde..65b907baa 100644 --- a/tests/Unit/FileExtensionTest.php +++ b/tests/Unit/FileExtensionTest.php @@ -9,8 +9,10 @@ use Intervention\Image\Format; use Intervention\Image\MediaType; use Intervention\Image\Tests\BaseTestCase; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; +#[CoversClass(FileExtension::class)] final class FileExtensionTest extends BaseTestCase { public function testFormatJpeg(): void diff --git a/tests/Unit/FileTest.php b/tests/Unit/FileTest.php index 79263c1d8..a34c82304 100644 --- a/tests/Unit/FileTest.php +++ b/tests/Unit/FileTest.php @@ -8,7 +8,7 @@ use Intervention\Image\File; use Intervention\Image\Tests\BaseTestCase; -#[CoversClass(\Intervention\Image\File::class)] +#[CoversClass(File::class)] final class FileTest extends BaseTestCase { public function testConstructor(): void diff --git a/tests/Unit/FormatTest.php b/tests/Unit/FormatTest.php index e578397be..5c405025e 100644 --- a/tests/Unit/FormatTest.php +++ b/tests/Unit/FormatTest.php @@ -18,7 +18,9 @@ use Intervention\Image\Format; use Intervention\Image\MediaType; use Intervention\Image\Tests\BaseTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +#[CoversClass(Format::class)] final class FormatTest extends BaseTestCase { public function testCreate(): void diff --git a/tests/Unit/Geometry/BezierTest.php b/tests/Unit/Geometry/BezierTest.php index 8eed7e91d..c757109d8 100644 --- a/tests/Unit/Geometry/BezierTest.php +++ b/tests/Unit/Geometry/BezierTest.php @@ -9,7 +9,7 @@ use Intervention\Image\Geometry\Bezier; use Intervention\Image\Tests\BaseTestCase; -#[CoversClass(\Intervention\Image\Geometry\Bezier::class)] +#[CoversClass(Bezier::class)] final class BezierTest extends BaseTestCase { public function testConstructor(): void diff --git a/tests/Unit/Geometry/CircleTest.php b/tests/Unit/Geometry/CircleTest.php index 155120251..fde9902c7 100644 --- a/tests/Unit/Geometry/CircleTest.php +++ b/tests/Unit/Geometry/CircleTest.php @@ -7,7 +7,9 @@ use Intervention\Image\Geometry\Circle; use Intervention\Image\Geometry\Point; use Intervention\Image\Tests\BaseTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +#[CoversClass(Circle::class)] final class CircleTest extends BaseTestCase { public function testConstructor(): void diff --git a/tests/Unit/Geometry/EllipseTest.php b/tests/Unit/Geometry/EllipseTest.php index 31e8c7bca..4e811bd52 100644 --- a/tests/Unit/Geometry/EllipseTest.php +++ b/tests/Unit/Geometry/EllipseTest.php @@ -7,7 +7,9 @@ use Intervention\Image\Geometry\Ellipse; use Intervention\Image\Geometry\Point; use Intervention\Image\Tests\BaseTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +#[CoversClass(Ellipse::class)] final class EllipseTest extends BaseTestCase { public function testConstructor(): void diff --git a/tests/Unit/Geometry/Factories/BezierFactoryTest.php b/tests/Unit/Geometry/Factories/BezierFactoryTest.php index a3e4ad30f..483dbda19 100644 --- a/tests/Unit/Geometry/Factories/BezierFactoryTest.php +++ b/tests/Unit/Geometry/Factories/BezierFactoryTest.php @@ -7,7 +7,9 @@ use Intervention\Image\Geometry\Factories\BezierFactory; use Intervention\Image\Geometry\Bezier; use Intervention\Image\Tests\BaseTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +#[CoversClass(BezierFactory::class)] final class BezierFactoryTest extends BaseTestCase { public function testFactoryCallback(): void diff --git a/tests/Unit/Geometry/Factories/CircleFactoryTest.php b/tests/Unit/Geometry/Factories/CircleFactoryTest.php index 2dbc9524a..1a830f64f 100644 --- a/tests/Unit/Geometry/Factories/CircleFactoryTest.php +++ b/tests/Unit/Geometry/Factories/CircleFactoryTest.php @@ -8,7 +8,9 @@ use Intervention\Image\Geometry\Factories\CircleFactory; use Intervention\Image\Geometry\Point; use Intervention\Image\Tests\BaseTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +#[CoversClass(CircleFactory::class)] final class CircleFactoryTest extends BaseTestCase { public function testFactoryCallback(): void diff --git a/tests/Unit/Geometry/Factories/DrawableTest.php b/tests/Unit/Geometry/Factories/DrawableTest.php index a0bbec778..3bc429ef2 100644 --- a/tests/Unit/Geometry/Factories/DrawableTest.php +++ b/tests/Unit/Geometry/Factories/DrawableTest.php @@ -12,7 +12,9 @@ use Intervention\Image\Geometry\Factories\PolygonFactory; use Intervention\Image\Geometry\Factories\RectangleFactory; use Intervention\Image\Tests\BaseTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +#[CoversClass(BezierFactory::class)] final class DrawableTest extends BaseTestCase { public function testBezier(): void diff --git a/tests/Unit/Geometry/Factories/EllipseFactoryTest.php b/tests/Unit/Geometry/Factories/EllipseFactoryTest.php index e5e37c26f..0b9bb9709 100644 --- a/tests/Unit/Geometry/Factories/EllipseFactoryTest.php +++ b/tests/Unit/Geometry/Factories/EllipseFactoryTest.php @@ -8,7 +8,9 @@ use Intervention\Image\Geometry\Factories\EllipseFactory; use Intervention\Image\Geometry\Point; use Intervention\Image\Tests\BaseTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +#[CoversClass(EllipseFactory::class)] final class EllipseFactoryTest extends BaseTestCase { public function testFactoryCallback(): void diff --git a/tests/Unit/Geometry/Factories/LineFactoryTest.php b/tests/Unit/Geometry/Factories/LineFactoryTest.php index 6870fe2ff..f3c3483c0 100644 --- a/tests/Unit/Geometry/Factories/LineFactoryTest.php +++ b/tests/Unit/Geometry/Factories/LineFactoryTest.php @@ -7,7 +7,9 @@ use Intervention\Image\Geometry\Factories\LineFactory; use Intervention\Image\Geometry\Line; use Intervention\Image\Tests\BaseTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +#[CoversClass(LineFactory::class)] final class LineFactoryTest extends BaseTestCase { public function testFactoryCallback(): void diff --git a/tests/Unit/Geometry/Factories/PolygonFactoryTest.php b/tests/Unit/Geometry/Factories/PolygonFactoryTest.php index ebc41f024..284dc04ff 100644 --- a/tests/Unit/Geometry/Factories/PolygonFactoryTest.php +++ b/tests/Unit/Geometry/Factories/PolygonFactoryTest.php @@ -7,7 +7,9 @@ use Intervention\Image\Geometry\Factories\PolygonFactory; use Intervention\Image\Geometry\Polygon; use Intervention\Image\Tests\BaseTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +#[CoversClass(PolygonFactory::class)] final class PolygonFactoryTest extends BaseTestCase { public function testFactoryCallback(): void diff --git a/tests/Unit/Geometry/Factories/RectangleFactoryTest.php b/tests/Unit/Geometry/Factories/RectangleFactoryTest.php index 79f86959e..b14b3bb13 100644 --- a/tests/Unit/Geometry/Factories/RectangleFactoryTest.php +++ b/tests/Unit/Geometry/Factories/RectangleFactoryTest.php @@ -8,7 +8,9 @@ use Intervention\Image\Geometry\Point; use Intervention\Image\Geometry\Rectangle; use Intervention\Image\Tests\BaseTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +#[CoversClass(RectangleFactory::class)] final class RectangleFactoryTest extends BaseTestCase { public function testFactoryCallback(): void diff --git a/tests/Unit/Geometry/LineTest.php b/tests/Unit/Geometry/LineTest.php index c0153a981..1b24c190e 100644 --- a/tests/Unit/Geometry/LineTest.php +++ b/tests/Unit/Geometry/LineTest.php @@ -7,7 +7,9 @@ use Intervention\Image\Geometry\Line; use Intervention\Image\Geometry\Point; use Intervention\Image\Tests\BaseTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +#[CoversClass(Line::class)] final class LineTest extends BaseTestCase { public function testConstructor(): void diff --git a/tests/Unit/Geometry/PixelTest.php b/tests/Unit/Geometry/PixelTest.php index 5115dde8e..00594e381 100644 --- a/tests/Unit/Geometry/PixelTest.php +++ b/tests/Unit/Geometry/PixelTest.php @@ -4,21 +4,20 @@ namespace Intervention\Image\Tests\Unit\Geometry; +use Intervention\Image\Colors\Rgb\Color; use PHPUnit\Framework\Attributes\CoversClass; use Intervention\Image\Geometry\Pixel; -use Intervention\Image\Interfaces\ColorInterface; use Intervention\Image\Tests\BaseTestCase; -use Mockery; -#[CoversClass(\Intervention\Image\Geometry\Pixel::class)] +#[CoversClass(Pixel::class)] final class PixelTest extends BaseTestCase { public function testSetGetBackground(): void { - $color = Mockery::mock(ColorInterface::class); - $pixel = new Pixel($color, 10, 12); + $color = new Color(255, 55, 0); + $pixel = new Pixel(new Color(0, 0, 0), 10, 12); $result = $pixel->setBackgroundColor($color); - $this->assertInstanceOf(ColorInterface::class, $pixel->backgroundColor()); + $this->assertEquals($color, $pixel->backgroundColor()); $this->assertInstanceOf(Pixel::class, $result); } } diff --git a/tests/Unit/Geometry/PointTest.php b/tests/Unit/Geometry/PointTest.php index 002ca0a6c..57167df3e 100644 --- a/tests/Unit/Geometry/PointTest.php +++ b/tests/Unit/Geometry/PointTest.php @@ -8,7 +8,7 @@ use Intervention\Image\Geometry\Point; use Intervention\Image\Tests\BaseTestCase; -#[CoversClass(\Intervention\Image\Geometry\Point::class)] +#[CoversClass(Point::class)] final class PointTest extends BaseTestCase { public function testConstructor(): void diff --git a/tests/Unit/Geometry/PolygonTest.php b/tests/Unit/Geometry/PolygonTest.php index 73e5890b6..fd4a5699b 100644 --- a/tests/Unit/Geometry/PolygonTest.php +++ b/tests/Unit/Geometry/PolygonTest.php @@ -9,7 +9,7 @@ use Intervention\Image\Geometry\Polygon; use Intervention\Image\Tests\BaseTestCase; -#[CoversClass(\Intervention\Image\Geometry\Polygon::class)] +#[CoversClass(Polygon::class)] final class PolygonTest extends BaseTestCase { public function testConstructor(): void diff --git a/tests/Unit/Geometry/RectangleResizerTest.php b/tests/Unit/Geometry/RectangleResizerTest.php index ee54aa4da..a5bbb455f 100644 --- a/tests/Unit/Geometry/RectangleResizerTest.php +++ b/tests/Unit/Geometry/RectangleResizerTest.php @@ -12,7 +12,7 @@ use Intervention\Image\Geometry\Tools\RectangleResizer; use PHPUnit\Framework\TestCase; -#[CoversClass(\Intervention\Image\Geometry\Tools\RectangleResizer::class)] +#[CoversClass(RectangleResizer::class)] final class RectangleResizerTest extends TestCase { public function testMake(): void diff --git a/tests/Unit/Geometry/RectangleTest.php b/tests/Unit/Geometry/RectangleTest.php index ff61fdfef..636987339 100644 --- a/tests/Unit/Geometry/RectangleTest.php +++ b/tests/Unit/Geometry/RectangleTest.php @@ -8,7 +8,9 @@ use Intervention\Image\Geometry\Rectangle; use Intervention\Image\Interfaces\PointInterface; use Intervention\Image\Tests\BaseTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +#[CoversClass(Rectangle::class)] final class RectangleTest extends BaseTestCase { public function testConstructor(): void diff --git a/tests/Unit/Geometry/Traits/HasBackgroundColorTest.php b/tests/Unit/Geometry/Traits/HasBackgroundColorTest.php index dea09bd1c..ad44e5117 100644 --- a/tests/Unit/Geometry/Traits/HasBackgroundColorTest.php +++ b/tests/Unit/Geometry/Traits/HasBackgroundColorTest.php @@ -6,7 +6,9 @@ use Intervention\Image\Geometry\Traits\HasBackgroundColor; use Intervention\Image\Tests\BaseTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +#[CoversClass(HasBackgroundColor::class)] final class HasBackgroundColorTest extends BaseTestCase { public function getTestObject(): object diff --git a/tests/Unit/Geometry/Traits/HasBorderTest.php b/tests/Unit/Geometry/Traits/HasBorderTest.php index 2d3116123..968b51e24 100644 --- a/tests/Unit/Geometry/Traits/HasBorderTest.php +++ b/tests/Unit/Geometry/Traits/HasBorderTest.php @@ -6,7 +6,9 @@ use Intervention\Image\Geometry\Traits\HasBorder; use Intervention\Image\Tests\BaseTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +#[CoversClass(HasBorder::class)] final class HasBorderTest extends BaseTestCase { public function getTestObject(): object diff --git a/tests/Unit/MediaTypeTest.php b/tests/Unit/MediaTypeTest.php index f792e8960..56aceba4a 100644 --- a/tests/Unit/MediaTypeTest.php +++ b/tests/Unit/MediaTypeTest.php @@ -9,8 +9,10 @@ use Intervention\Image\Format; use Intervention\Image\MediaType; use Intervention\Image\Tests\BaseTestCase; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; +#[CoversClass(MediaType::class)] final class MediaTypeTest extends BaseTestCase { public function testFormatJpeg(): void diff --git a/tests/Unit/ModifierStackTest.php b/tests/Unit/ModifierStackTest.php index 8d63f4239..5a66b2005 100644 --- a/tests/Unit/ModifierStackTest.php +++ b/tests/Unit/ModifierStackTest.php @@ -12,7 +12,7 @@ use Intervention\Image\Tests\BaseTestCase; use Mockery; -#[CoversClass(\Intervention\Image\ModifierStack::class)] +#[CoversClass(ModifierStack::class)] final class ModifierStackTest extends BaseTestCase { public function testConstructor(): void diff --git a/tests/Unit/Modifiers/ColorspaceModifierTest.php b/tests/Unit/Modifiers/ColorspaceModifierTest.php index d5cfc12e6..4e7ece978 100644 --- a/tests/Unit/Modifiers/ColorspaceModifierTest.php +++ b/tests/Unit/Modifiers/ColorspaceModifierTest.php @@ -9,7 +9,9 @@ use Intervention\Image\Interfaces\ColorspaceInterface; use Intervention\Image\Modifiers\ColorspaceModifier; use Intervention\Image\Tests\BaseTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +#[CoversClass(ColorspaceModifier::class)] final class ColorspaceModifierTest extends BaseTestCase { public function testTargetColorspace(): void diff --git a/tests/Unit/Modifiers/PadModifierTest.php b/tests/Unit/Modifiers/PadModifierTest.php index 777c7752f..1421ca2c3 100644 --- a/tests/Unit/Modifiers/PadModifierTest.php +++ b/tests/Unit/Modifiers/PadModifierTest.php @@ -10,7 +10,9 @@ use Intervention\Image\Modifiers\PadModifier; use Intervention\Image\Tests\BaseTestCase; use Mockery; +use PHPUnit\Framework\Attributes\CoversClass; +#[CoversClass(PadModifier::class)] final class PadModifierTest extends BaseTestCase { public function testGetCropSize(): void diff --git a/tests/Unit/Modifiers/TextModifierTest.php b/tests/Unit/Modifiers/TextModifierTest.php index 6db0c88ff..50b3d9bac 100644 --- a/tests/Unit/Modifiers/TextModifierTest.php +++ b/tests/Unit/Modifiers/TextModifierTest.php @@ -8,7 +8,9 @@ use Intervention\Image\Modifiers\TextModifier; use Intervention\Image\Tests\BaseTestCase; use Intervention\Image\Typography\Font; +use PHPUnit\Framework\Attributes\CoversClass; +#[CoversClass(TextModifier::class)] final class TextModifierTest extends BaseTestCase { public function testStrokeOffsets(): void diff --git a/tests/Unit/OriginTest.php b/tests/Unit/OriginTest.php index 2932ed48c..64ef06a33 100644 --- a/tests/Unit/OriginTest.php +++ b/tests/Unit/OriginTest.php @@ -6,7 +6,9 @@ use Intervention\Image\Origin; use Intervention\Image\Tests\BaseTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +#[CoversClass(Origin::class)] final class OriginTest extends BaseTestCase { public function testFilePath(): void diff --git a/tests/Unit/ResolutionTest.php b/tests/Unit/ResolutionTest.php index e0e4c844f..1e09748a9 100644 --- a/tests/Unit/ResolutionTest.php +++ b/tests/Unit/ResolutionTest.php @@ -8,7 +8,7 @@ use Intervention\Image\Resolution; use Intervention\Image\Tests\BaseTestCase; -#[CoversClass(\Intervention\Image\Resolution::class)] +#[CoversClass(Resolution::class)] final class ResolutionTest extends BaseTestCase { public function testConstructor(): void diff --git a/tests/Unit/Typography/FontFactoryTest.php b/tests/Unit/Typography/FontFactoryTest.php index 7afd9e80d..277bf3990 100644 --- a/tests/Unit/Typography/FontFactoryTest.php +++ b/tests/Unit/Typography/FontFactoryTest.php @@ -8,7 +8,9 @@ use Intervention\Image\Tests\BaseTestCase; use Intervention\Image\Typography\Font; use Intervention\Image\Typography\FontFactory; +use PHPUnit\Framework\Attributes\CoversClass; +#[CoversClass(FontFactory::class)] final class FontFactoryTest extends BaseTestCase { public function testBuildWithFont(): void diff --git a/tests/Unit/Typography/FontTest.php b/tests/Unit/Typography/FontTest.php index 06e68b299..724ddc74a 100644 --- a/tests/Unit/Typography/FontTest.php +++ b/tests/Unit/Typography/FontTest.php @@ -7,7 +7,9 @@ use Intervention\Image\Exceptions\FontException; use Intervention\Image\Tests\BaseTestCase; use Intervention\Image\Typography\Font; +use PHPUnit\Framework\Attributes\CoversClass; +#[CoversClass(Font::class)] final class FontTest extends BaseTestCase { public function testConstructor(): void diff --git a/tests/Unit/Typography/LineTest.php b/tests/Unit/Typography/LineTest.php index 4f313441c..b68bb3da5 100644 --- a/tests/Unit/Typography/LineTest.php +++ b/tests/Unit/Typography/LineTest.php @@ -7,7 +7,9 @@ use Intervention\Image\Geometry\Point; use Intervention\Image\Tests\BaseTestCase; use Intervention\Image\Typography\Line; +use PHPUnit\Framework\Attributes\CoversClass; +#[CoversClass(Line::class)] final class LineTest extends BaseTestCase { public function testConstructor(): void diff --git a/tests/Unit/Typography/TextBlockTest.php b/tests/Unit/Typography/TextBlockTest.php index 2ed9329a2..8555bc710 100644 --- a/tests/Unit/Typography/TextBlockTest.php +++ b/tests/Unit/Typography/TextBlockTest.php @@ -6,7 +6,9 @@ use Intervention\Image\Tests\BaseTestCase; use Intervention\Image\Typography\TextBlock; +use PHPUnit\Framework\Attributes\CoversClass; +#[CoversClass(TextBlock::class)] final class TextBlockTest extends BaseTestCase { protected TextBlock $block; From 7336dab1d0739ef796e3ff4d9f1d69583639a3f5 Mon Sep 17 00:00:00 2001 From: Oliver Vogel Date: Sun, 8 Dec 2024 08:59:03 +0100 Subject: [PATCH 2/2] Remove whitespace --- tests/Unit/Colors/Cmyk/ChannelTest.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/Unit/Colors/Cmyk/ChannelTest.php b/tests/Unit/Colors/Cmyk/ChannelTest.php index c397e3ce4..2c7aa5156 100644 --- a/tests/Unit/Colors/Cmyk/ChannelTest.php +++ b/tests/Unit/Colors/Cmyk/ChannelTest.php @@ -20,13 +20,13 @@ final class ChannelTest extends BaseTestCase { public function testConstructor(): void { - $channel = new Cyan(0); + $channel = new Cyan(0); $this->assertInstanceOf(Cyan::class, $channel); - $channel = new Cyan(value: 0); + $channel = new Cyan(value: 0); $this->assertInstanceOf(Cyan::class, $channel); - $channel = new Cyan(normalized: 0); + $channel = new Cyan(normalized: 0); $this->assertInstanceOf(Cyan::class, $channel); $this->expectException(ColorException::class); @@ -44,30 +44,30 @@ public function testConstructorFail(): void public function testToInt(): void { - $channel = new Cyan(10); + $channel = new Cyan(10); $this->assertEquals(10, $channel->toInt()); } public function testToString(): void { - $channel = new Cyan(10); + $channel = new Cyan(10); $this->assertEquals("10", $channel->toString()); $this->assertEquals("10", (string) $channel); } public function testValue(): void { - $channel = new Cyan(10); + $channel = new Cyan(10); $this->assertEquals(10, $channel->value()); } public function testNormalize(): void { - $channel = new Cyan(100); + $channel = new Cyan(100); $this->assertEquals(1, $channel->normalize()); - $channel = new Cyan(0); + $channel = new Cyan(0); $this->assertEquals(0, $channel->normalize()); - $channel = new Cyan(20); + $channel = new Cyan(20); $this->assertEquals(.2, $channel->normalize()); }