Skip to content

Commit

Permalink
Squashed all mutants
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Kolb committed Jun 9, 2024
1 parent 9c8306a commit b32f3b6
Show file tree
Hide file tree
Showing 8 changed files with 168 additions and 16 deletions.
23 changes: 21 additions & 2 deletions tests/Moment/IsAfterInTimeZoneTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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
Expand All @@ -35,7 +36,7 @@ public function is_after_in_time_zone_works(
* @return array<string, array{
* 0: boolean,
* 1: Moment,
* 2: Time | Date | Month | Year,
* 2: Time | Weekday | Date | Month | Year,
* 3: \DateTimeZone,
* }>
*/
Expand All @@ -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')),
Expand Down
23 changes: 21 additions & 2 deletions tests/Moment/IsAfterOrEqualToInTimeZoneTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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
Expand All @@ -35,7 +36,7 @@ public function is_after_or_equal_to_in_time_zone_works(
* @return array<string, array{
* 0: boolean,
* 1: Moment,
* 2: Time | Date | Month | Year,
* 2: Time | Weekday | Date | Month | Year,
* 3: \DateTimeZone,
* }>
*/
Expand All @@ -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')),
Expand Down
23 changes: 21 additions & 2 deletions tests/Moment/IsBeforeInTimeZoneTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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
Expand All @@ -35,7 +36,7 @@ public function is_before_in_time_zone_works(
* @return array<string, array{
* 0: boolean,
* 1: Moment,
* 2: Time | Date | Month | Year,
* 2: Time | Weekday | Date | Month | Year,
* 3: \DateTimeZone,
* }>
*/
Expand All @@ -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')),
Expand Down
23 changes: 21 additions & 2 deletions tests/Moment/IsBeforeOrEqualToInTimeZoneTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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
Expand All @@ -35,7 +36,7 @@ public function is_before_or_equal_to_in_time_zone_works(
* @return array<string, array{
* 0: boolean,
* 1: Moment,
* 2: Time | Date | Month | Year,
* 2: Time | Weekday | Date | Month | Year,
* 3: \DateTimeZone,
* }>
*/
Expand All @@ -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')),
Expand Down
23 changes: 21 additions & 2 deletions tests/Moment/IsNotAfterInTimeZoneTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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
Expand All @@ -35,7 +36,7 @@ public function is_not_after_in_time_zone_works(
* @return array<string, array{
* 0: boolean,
* 1: Moment,
* 2: Time | Date | Month | Year,
* 2: Time | Weekday | Date | Month | Year,
* 3: \DateTimeZone,
* }>
*/
Expand All @@ -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')),
Expand Down
23 changes: 21 additions & 2 deletions tests/Moment/IsNotAfterOrEqualToInTimeZoneTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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
Expand All @@ -35,7 +36,7 @@ public function is_not_after_or_equal_to_in_time_zone_works(
* @return array<string, array{
* 0: boolean,
* 1: Moment,
* 2: Time | Date | Month | Year,
* 2: Time | Weekday | Date | Month | Year,
* 3: \DateTimeZone,
* }>
*/
Expand All @@ -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')),
Expand Down
23 changes: 21 additions & 2 deletions tests/Moment/IsNotBeforeInTimeZoneTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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
Expand All @@ -35,7 +36,7 @@ public function is_not_before_in_time_zone_works(
* @return array<string, array{
* 0: boolean,
* 1: Moment,
* 2: Time | Date | Month | Year,
* 2: Time | Weekday | Date | Month | Year,
* 3: \DateTimeZone,
* }>
*/
Expand All @@ -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')),
Expand Down
Loading

0 comments on commit b32f3b6

Please sign in to comment.