Skip to content

Commit

Permalink
Add extra tests to cover all edge cases of times
Browse files Browse the repository at this point in the history
  • Loading branch information
BenMorel committed Feb 5, 2024
1 parent aff7c02 commit ae38f9b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion tests/Types/LocalDateTimeTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ public static function providerConvertToDatabaseValue(): array
[null, null],
[LocalDateTime::of(2021, 4, 17, 9, 2), '2021-04-17 09:02:00'],
[LocalDateTime::of(2021, 4, 17, 9, 2, 7), '2021-04-17 09:02:07'],
[LocalDateTime::of(2021, 4, 17, 9, 2, 0, 7000000), '2021-04-17 09:02:00.007'],
[LocalDateTime::of(2021, 4, 17, 9, 2, 0, 7_000_000), '2021-04-17 09:02:00.007'],
[LocalDateTime::of(2021, 4, 17, 9, 2, 1, 7_000_000), '2021-04-17 09:02:01.007'],
];
}

Expand Down
3 changes: 2 additions & 1 deletion tests/Types/LocalTimeTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ public static function providerConvertToDatabaseValue(): array
[null, null],
[LocalTime::of(9, 2), '09:02:00'],
[LocalTime::of(10, 31, 1), '10:31:01'],
[LocalTime::of(10, 31, 1, 7000000), '10:31:01.007'],
[LocalTime::of(10, 31, 0, 7_000_000), '10:31:00.007'],
[LocalTime::of(10, 31, 1, 7_000_000), '10:31:01.007'],
];
}

Expand Down

0 comments on commit ae38f9b

Please sign in to comment.