From b32f3b68e1cb3859aa165775ffcf684ce78563d1 Mon Sep 17 00:00:00 2001 From: Christian Kolb Date: Sun, 9 Jun 2024 10:15:14 +0200 Subject: [PATCH] Squashed all mutants --- tests/Moment/IsAfterInTimeZoneTest.php | 23 +++++++++++++++++-- .../Moment/IsAfterOrEqualToInTimeZoneTest.php | 23 +++++++++++++++++-- tests/Moment/IsBeforeInTimeZoneTest.php | 23 +++++++++++++++++-- .../IsBeforeOrEqualToInTimeZoneTest.php | 23 +++++++++++++++++-- tests/Moment/IsNotAfterInTimeZoneTest.php | 23 +++++++++++++++++-- .../IsNotAfterOrEqualToInTimeZoneTest.php | 23 +++++++++++++++++-- tests/Moment/IsNotBeforeInTimeZoneTest.php | 23 +++++++++++++++++-- .../IsNotBeforeOrEqualToInTimeZoneTest.php | 23 +++++++++++++++++-- 8 files changed, 168 insertions(+), 16 deletions(-) diff --git a/tests/Moment/IsAfterInTimeZoneTest.php b/tests/Moment/IsAfterInTimeZoneTest.php index bafc998..028339d 100644 --- a/tests/Moment/IsAfterInTimeZoneTest.php +++ b/tests/Moment/IsAfterInTimeZoneTest.php @@ -8,6 +8,7 @@ use DigitalCraftsman\DateTimePrecision\Moment; use DigitalCraftsman\DateTimePrecision\Month; use DigitalCraftsman\DateTimePrecision\Time; +use DigitalCraftsman\DateTimePrecision\Weekday; use DigitalCraftsman\DateTimePrecision\Year; use PHPUnit\Framework\TestCase; @@ -24,7 +25,7 @@ final class IsAfterInTimeZoneTest extends TestCase public function is_after_in_time_zone_works( bool $expectedResult, Moment $moment, - Time | Date | Month | Year $comparator, + Time | Weekday | Date | Month | Year $comparator, \DateTimeZone $timeZone, ): void { // -- Act & Assert @@ -35,7 +36,7 @@ public function is_after_in_time_zone_works( * @return array */ @@ -60,6 +61,24 @@ public static function dataProvider(): array Time::fromString('15:00:00'), new \DateTimeZone('Europe/Berlin'), ], + 'moment before weekday' => [ + false, + Moment::fromStringInTimeZone('2022-10-07 15:00:00', new \DateTimeZone('Europe/Berlin')), + Weekday::SATURDAY, + new \DateTimeZone('Europe/Berlin'), + ], + 'moment same weekday' => [ + false, + Moment::fromStringInTimeZone('2022-10-08 15:00:00', new \DateTimeZone('Europe/Berlin')), + Weekday::SATURDAY, + new \DateTimeZone('Europe/Berlin'), + ], + 'moment after weekday' => [ + true, + Moment::fromStringInTimeZone('2022-10-09 15:00:00', new \DateTimeZone('Europe/Berlin')), + Weekday::SATURDAY, + new \DateTimeZone('Europe/Berlin'), + ], 'moment before date' => [ false, Moment::fromStringInTimeZone('2022-10-07 15:00:00', new \DateTimeZone('Europe/Berlin')), diff --git a/tests/Moment/IsAfterOrEqualToInTimeZoneTest.php b/tests/Moment/IsAfterOrEqualToInTimeZoneTest.php index 45d76d6..17bb5a7 100644 --- a/tests/Moment/IsAfterOrEqualToInTimeZoneTest.php +++ b/tests/Moment/IsAfterOrEqualToInTimeZoneTest.php @@ -8,6 +8,7 @@ use DigitalCraftsman\DateTimePrecision\Moment; use DigitalCraftsman\DateTimePrecision\Month; use DigitalCraftsman\DateTimePrecision\Time; +use DigitalCraftsman\DateTimePrecision\Weekday; use DigitalCraftsman\DateTimePrecision\Year; use PHPUnit\Framework\TestCase; @@ -24,7 +25,7 @@ final class IsAfterOrEqualToInTimeZoneTest extends TestCase public function is_after_or_equal_to_in_time_zone_works( bool $expectedResult, Moment $moment, - Time | Date | Month | Year $comparator, + Time | Weekday | Date | Month | Year $comparator, \DateTimeZone $timeZone, ): void { // -- Act & Assert @@ -35,7 +36,7 @@ public function is_after_or_equal_to_in_time_zone_works( * @return array */ @@ -60,6 +61,24 @@ public static function dataProvider(): array Time::fromString('15:00:00'), new \DateTimeZone('Europe/Berlin'), ], + 'moment before weekday' => [ + false, + Moment::fromStringInTimeZone('2022-10-07 15:00:00', new \DateTimeZone('Europe/Berlin')), + Weekday::SATURDAY, + new \DateTimeZone('Europe/Berlin'), + ], + 'moment same weekday' => [ + true, + Moment::fromStringInTimeZone('2022-10-08 15:00:00', new \DateTimeZone('Europe/Berlin')), + Weekday::SATURDAY, + new \DateTimeZone('Europe/Berlin'), + ], + 'moment after weekday' => [ + true, + Moment::fromStringInTimeZone('2022-10-09 15:00:00', new \DateTimeZone('Europe/Berlin')), + Weekday::SATURDAY, + new \DateTimeZone('Europe/Berlin'), + ], 'moment before date' => [ false, Moment::fromStringInTimeZone('2022-10-07 15:00:00', new \DateTimeZone('Europe/Berlin')), diff --git a/tests/Moment/IsBeforeInTimeZoneTest.php b/tests/Moment/IsBeforeInTimeZoneTest.php index 197c34d..61bda0b 100644 --- a/tests/Moment/IsBeforeInTimeZoneTest.php +++ b/tests/Moment/IsBeforeInTimeZoneTest.php @@ -8,6 +8,7 @@ use DigitalCraftsman\DateTimePrecision\Moment; use DigitalCraftsman\DateTimePrecision\Month; use DigitalCraftsman\DateTimePrecision\Time; +use DigitalCraftsman\DateTimePrecision\Weekday; use DigitalCraftsman\DateTimePrecision\Year; use PHPUnit\Framework\TestCase; @@ -24,7 +25,7 @@ final class IsBeforeInTimeZoneTest extends TestCase public function is_before_in_time_zone_works( bool $expectedResult, Moment $moment, - Time | Date | Month | Year $comparator, + Time | Weekday | Date | Month | Year $comparator, \DateTimeZone $timeZone, ): void { // -- Act & Assert @@ -35,7 +36,7 @@ public function is_before_in_time_zone_works( * @return array */ @@ -60,6 +61,24 @@ public static function dataProvider(): array Time::fromString('15:00:00'), new \DateTimeZone('Europe/Berlin'), ], + 'moment before weekday' => [ + true, + Moment::fromStringInTimeZone('2022-10-07 15:00:00', new \DateTimeZone('Europe/Berlin')), + Weekday::SATURDAY, + new \DateTimeZone('Europe/Berlin'), + ], + 'moment same weekday' => [ + false, + Moment::fromStringInTimeZone('2022-10-08 15:00:00', new \DateTimeZone('Europe/Berlin')), + Weekday::SATURDAY, + new \DateTimeZone('Europe/Berlin'), + ], + 'moment after weekday' => [ + false, + Moment::fromStringInTimeZone('2022-10-09 15:00:00', new \DateTimeZone('Europe/Berlin')), + Weekday::SATURDAY, + new \DateTimeZone('Europe/Berlin'), + ], 'moment before date' => [ true, Moment::fromStringInTimeZone('2022-10-07 15:00:00', new \DateTimeZone('Europe/Berlin')), diff --git a/tests/Moment/IsBeforeOrEqualToInTimeZoneTest.php b/tests/Moment/IsBeforeOrEqualToInTimeZoneTest.php index 17066f7..4b2c6b4 100644 --- a/tests/Moment/IsBeforeOrEqualToInTimeZoneTest.php +++ b/tests/Moment/IsBeforeOrEqualToInTimeZoneTest.php @@ -8,6 +8,7 @@ use DigitalCraftsman\DateTimePrecision\Moment; use DigitalCraftsman\DateTimePrecision\Month; use DigitalCraftsman\DateTimePrecision\Time; +use DigitalCraftsman\DateTimePrecision\Weekday; use DigitalCraftsman\DateTimePrecision\Year; use PHPUnit\Framework\TestCase; @@ -24,7 +25,7 @@ final class IsBeforeOrEqualToInTimeZoneTest extends TestCase public function is_before_or_equal_to_in_time_zone_works( bool $expectedResult, Moment $moment, - Time | Date | Month | Year $comparator, + Time | Weekday | Date | Month | Year $comparator, \DateTimeZone $timeZone, ): void { // -- Act & Assert @@ -35,7 +36,7 @@ public function is_before_or_equal_to_in_time_zone_works( * @return array */ @@ -60,6 +61,24 @@ public static function dataProvider(): array Time::fromString('15:00:00'), new \DateTimeZone('Europe/Berlin'), ], + 'moment before weekday' => [ + true, + Moment::fromStringInTimeZone('2022-10-07 15:00:00', new \DateTimeZone('Europe/Berlin')), + Weekday::SATURDAY, + new \DateTimeZone('Europe/Berlin'), + ], + 'moment same weekday' => [ + true, + Moment::fromStringInTimeZone('2022-10-08 15:00:00', new \DateTimeZone('Europe/Berlin')), + Weekday::SATURDAY, + new \DateTimeZone('Europe/Berlin'), + ], + 'moment after weekday' => [ + false, + Moment::fromStringInTimeZone('2022-10-09 15:00:00', new \DateTimeZone('Europe/Berlin')), + Weekday::SATURDAY, + new \DateTimeZone('Europe/Berlin'), + ], 'moment before date' => [ true, Moment::fromStringInTimeZone('2022-10-07 15:00:00', new \DateTimeZone('Europe/Berlin')), diff --git a/tests/Moment/IsNotAfterInTimeZoneTest.php b/tests/Moment/IsNotAfterInTimeZoneTest.php index 829ab0c..e34c7b5 100644 --- a/tests/Moment/IsNotAfterInTimeZoneTest.php +++ b/tests/Moment/IsNotAfterInTimeZoneTest.php @@ -8,6 +8,7 @@ use DigitalCraftsman\DateTimePrecision\Moment; use DigitalCraftsman\DateTimePrecision\Month; use DigitalCraftsman\DateTimePrecision\Time; +use DigitalCraftsman\DateTimePrecision\Weekday; use DigitalCraftsman\DateTimePrecision\Year; use PHPUnit\Framework\TestCase; @@ -24,7 +25,7 @@ final class IsNotAfterInTimeZoneTest extends TestCase public function is_not_after_in_time_zone_works( bool $expectedResult, Moment $moment, - Time | Date | Month | Year $comparator, + Time | Weekday | Date | Month | Year $comparator, \DateTimeZone $timeZone, ): void { // -- Act & Assert @@ -35,7 +36,7 @@ public function is_not_after_in_time_zone_works( * @return array */ @@ -60,6 +61,24 @@ public static function dataProvider(): array Time::fromString('15:00:00'), new \DateTimeZone('Europe/Berlin'), ], + 'moment before weekday' => [ + true, + Moment::fromStringInTimeZone('2022-10-07 15:00:00', new \DateTimeZone('Europe/Berlin')), + Weekday::SATURDAY, + new \DateTimeZone('Europe/Berlin'), + ], + 'moment same weekday' => [ + true, + Moment::fromStringInTimeZone('2022-10-08 15:00:00', new \DateTimeZone('Europe/Berlin')), + Weekday::SATURDAY, + new \DateTimeZone('Europe/Berlin'), + ], + 'moment after weekday' => [ + false, + Moment::fromStringInTimeZone('2022-10-09 15:00:00', new \DateTimeZone('Europe/Berlin')), + Weekday::SATURDAY, + new \DateTimeZone('Europe/Berlin'), + ], 'moment before date' => [ true, Moment::fromStringInTimeZone('2022-10-07 15:00:00', new \DateTimeZone('Europe/Berlin')), diff --git a/tests/Moment/IsNotAfterOrEqualToInTimeZoneTest.php b/tests/Moment/IsNotAfterOrEqualToInTimeZoneTest.php index 21f0a7b..7e0f046 100644 --- a/tests/Moment/IsNotAfterOrEqualToInTimeZoneTest.php +++ b/tests/Moment/IsNotAfterOrEqualToInTimeZoneTest.php @@ -8,6 +8,7 @@ use DigitalCraftsman\DateTimePrecision\Moment; use DigitalCraftsman\DateTimePrecision\Month; use DigitalCraftsman\DateTimePrecision\Time; +use DigitalCraftsman\DateTimePrecision\Weekday; use DigitalCraftsman\DateTimePrecision\Year; use PHPUnit\Framework\TestCase; @@ -24,7 +25,7 @@ final class IsNotAfterOrEqualToInTimeZoneTest extends TestCase public function is_not_after_or_equal_to_in_time_zone_works( bool $expectedResult, Moment $moment, - Time | Date | Month | Year $comparator, + Time | Weekday | Date | Month | Year $comparator, \DateTimeZone $timeZone, ): void { // -- Act & Assert @@ -35,7 +36,7 @@ public function is_not_after_or_equal_to_in_time_zone_works( * @return array */ @@ -60,6 +61,24 @@ public static function dataProvider(): array Time::fromString('15:00:00'), new \DateTimeZone('Europe/Berlin'), ], + 'moment before weekday' => [ + true, + Moment::fromStringInTimeZone('2022-10-07 15:00:00', new \DateTimeZone('Europe/Berlin')), + Weekday::SATURDAY, + new \DateTimeZone('Europe/Berlin'), + ], + 'moment same weekday' => [ + false, + Moment::fromStringInTimeZone('2022-10-08 15:00:00', new \DateTimeZone('Europe/Berlin')), + Weekday::SATURDAY, + new \DateTimeZone('Europe/Berlin'), + ], + 'moment after weekday' => [ + false, + Moment::fromStringInTimeZone('2022-10-09 15:00:00', new \DateTimeZone('Europe/Berlin')), + Weekday::SATURDAY, + new \DateTimeZone('Europe/Berlin'), + ], 'moment before date' => [ true, Moment::fromStringInTimeZone('2022-10-07 15:00:00', new \DateTimeZone('Europe/Berlin')), diff --git a/tests/Moment/IsNotBeforeInTimeZoneTest.php b/tests/Moment/IsNotBeforeInTimeZoneTest.php index 0a1bcd1..4d1f5b0 100644 --- a/tests/Moment/IsNotBeforeInTimeZoneTest.php +++ b/tests/Moment/IsNotBeforeInTimeZoneTest.php @@ -8,6 +8,7 @@ use DigitalCraftsman\DateTimePrecision\Moment; use DigitalCraftsman\DateTimePrecision\Month; use DigitalCraftsman\DateTimePrecision\Time; +use DigitalCraftsman\DateTimePrecision\Weekday; use DigitalCraftsman\DateTimePrecision\Year; use PHPUnit\Framework\TestCase; @@ -24,7 +25,7 @@ final class IsNotBeforeInTimeZoneTest extends TestCase public function is_not_before_in_time_zone_works( bool $expectedResult, Moment $moment, - Time | Date | Month | Year $comparator, + Time | Weekday | Date | Month | Year $comparator, \DateTimeZone $timeZone, ): void { // -- Act & Assert @@ -35,7 +36,7 @@ public function is_not_before_in_time_zone_works( * @return array */ @@ -60,6 +61,24 @@ public static function dataProvider(): array Time::fromString('15:00:00'), new \DateTimeZone('Europe/Berlin'), ], + 'moment before weekday' => [ + false, + Moment::fromStringInTimeZone('2022-10-07 15:00:00', new \DateTimeZone('Europe/Berlin')), + Weekday::SATURDAY, + new \DateTimeZone('Europe/Berlin'), + ], + 'moment same weekday' => [ + true, + Moment::fromStringInTimeZone('2022-10-08 15:00:00', new \DateTimeZone('Europe/Berlin')), + Weekday::SATURDAY, + new \DateTimeZone('Europe/Berlin'), + ], + 'moment after weekday' => [ + true, + Moment::fromStringInTimeZone('2022-10-09 15:00:00', new \DateTimeZone('Europe/Berlin')), + Weekday::SATURDAY, + new \DateTimeZone('Europe/Berlin'), + ], 'moment before date' => [ false, Moment::fromStringInTimeZone('2022-10-07 15:00:00', new \DateTimeZone('Europe/Berlin')), diff --git a/tests/Moment/IsNotBeforeOrEqualToInTimeZoneTest.php b/tests/Moment/IsNotBeforeOrEqualToInTimeZoneTest.php index 7d28831..18df559 100644 --- a/tests/Moment/IsNotBeforeOrEqualToInTimeZoneTest.php +++ b/tests/Moment/IsNotBeforeOrEqualToInTimeZoneTest.php @@ -8,6 +8,7 @@ use DigitalCraftsman\DateTimePrecision\Moment; use DigitalCraftsman\DateTimePrecision\Month; use DigitalCraftsman\DateTimePrecision\Time; +use DigitalCraftsman\DateTimePrecision\Weekday; use DigitalCraftsman\DateTimePrecision\Year; use PHPUnit\Framework\TestCase; @@ -24,7 +25,7 @@ final class IsNotBeforeOrEqualToInTimeZoneTest extends TestCase public function is_not_before_or_equal_to_in_time_zone_works( bool $expectedResult, Moment $moment, - Time | Date | Month | Year $comparator, + Time | Weekday | Date | Month | Year $comparator, \DateTimeZone $timeZone, ): void { // -- Act & Assert @@ -35,7 +36,7 @@ public function is_not_before_or_equal_to_in_time_zone_works( * @return array */ @@ -60,6 +61,24 @@ public static function dataProvider(): array Time::fromString('15:00:00'), new \DateTimeZone('Europe/Berlin'), ], + 'moment before weekday' => [ + false, + Moment::fromStringInTimeZone('2022-10-07 15:00:00', new \DateTimeZone('Europe/Berlin')), + Weekday::SATURDAY, + new \DateTimeZone('Europe/Berlin'), + ], + 'moment same weekday' => [ + false, + Moment::fromStringInTimeZone('2022-10-08 15:00:00', new \DateTimeZone('Europe/Berlin')), + Weekday::SATURDAY, + new \DateTimeZone('Europe/Berlin'), + ], + 'moment after weekday' => [ + true, + Moment::fromStringInTimeZone('2022-10-09 15:00:00', new \DateTimeZone('Europe/Berlin')), + Weekday::SATURDAY, + new \DateTimeZone('Europe/Berlin'), + ], 'moment before date' => [ false, Moment::fromStringInTimeZone('2022-10-07 15:00:00', new \DateTimeZone('Europe/Berlin')),