From 9f96d0e1d5de96ff747a262f4dc2761a33ba33f6 Mon Sep 17 00:00:00 2001 From: Alexey Rogachev Date: Wed, 3 Apr 2024 18:12:00 +0500 Subject: [PATCH] Fix new mutants --- tests/Rule/Image/ImageTest.php | 37 ++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/tests/Rule/Image/ImageTest.php b/tests/Rule/Image/ImageTest.php index 4d091783b..0b4c98d0a 100644 --- a/tests/Rule/Image/ImageTest.php +++ b/tests/Rule/Image/ImageTest.php @@ -172,26 +172,63 @@ public function dataValidationFailed(): array ], ], ], + 'not-exactly-with-custom-message' => [ + ['a' => __DIR__ . '/16x18.jpg'], + [ + 'a' => new Image( + width: 24, + height: 32, + notExactWidthMessage: 'Attribute - {attribute}, exactly - {exactly}.', + notExactHeightMessage: 'Attribute - {attribute}, exactly - {exactly}.', + ), + ], + [ + 'a' => [ + 'Attribute - a, exactly - 24.', + 'Attribute - a, exactly - 32.', + ], + ], + ], 'too-small-width' => [ __DIR__ . '/16x18.jpg', new Image(minWidth: 17), ['' => ['The width cannot be smaller than 17 pixels.']], ], + 'too-small-width-with-custom-message' => [ + ['a' => __DIR__ . '/16x18.jpg'], + ['a' => new Image(minWidth: 17, tooSmallWidthMessage: 'Attribute - {attribute}, limit - {limit}.')], + ['a' => ['Attribute - a, limit - 17.']], + ], 'too-small-height' => [ __DIR__ . '/16x18.jpg', new Image(minHeight: 19), ['' => ['The height cannot be smaller than 19 pixels.']], ], + 'too-small-height-with-custom-message' => [ + ['a' => __DIR__ . '/16x18.jpg'], + ['a' => new Image(minHeight: 19, tooSmallHeightMessage: 'Attribute - {attribute}, limit - {limit}.')], + ['a' => ['Attribute - a, limit - 19.']], + ], 'too-large-width' => [ __DIR__ . '/16x18.jpg', new Image(maxWidth: 15), ['' => ['The width cannot be larger than 15 pixels.']], ], + 'too-large-width-with-custom-message' => [ + ['a' => __DIR__ . '/16x18.jpg'], + ['a' => new Image(maxWidth: 15, tooLargeWidthMessage: 'Attribute - {attribute}, limit - {limit}.')], + ['a' => ['Attribute - a, limit - 15.']], + ], 'too-large-height' => [ __DIR__ . '/16x18.jpg', new Image(maxHeight: 17), ['' => ['The height cannot be larger than 17 pixels.']], ], + 'too-large-height-with-custom-message' => [ + ['a' => __DIR__ . '/16x18.jpg'], + ['a' => new Image(maxHeight: 17, tooLargeHeightMessage: 'Attribute - {attribute}, limit - {limit}.')], + ['a' => ['Attribute - a, limit - 17.']], + ], ]; }