Skip to content

Commit

Permalink
fix(ParseTest): use current year
Browse files Browse the repository at this point in the history
  • Loading branch information
h4kuna committed Feb 26, 2024
1 parent 18ec486 commit 1047081
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/src/Unit/Date/ParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ final class ParserTest extends TestCase
*/
public function provideMakeFromString(): array
{
$y = date('Y');
return [
['expected' => '2023-06-11 07:00:00', 'input' => ''],
['expected' => self::format(new DateTime()), 'input' => 'now'],
['expected' => '2023-06-11 07:00:00', 'input' => '0'],
['expected' => '2023-06-11 07:30:00', 'input' => '0.5'],
// // decimal number has same behavior with or without +
// decimal number has same behavior with or without +
['expected' => '2023-06-11 07:30:00', 'input' => '+0.5'],
['expected' => '2023-06-11 07:30:00', 'input' => '+0,5'],
['expected' => '2023-06-11 08:45:00', 'input' => '+1,75'],
Expand All @@ -40,7 +41,7 @@ public function provideMakeFromString(): array
['expected' => '2023-06-11 14:45:00', 'input' => '+7:45'],
['expected' => '2023-06-10 23:15:00', 'input' => '-7:45'],
['expected' => '2023-06-11 05:30:00', 'input' => '5:30'],
['expected' => '2023-06-12 06:45:00', 'input' => '12.6. 6:45'],
['expected' => "$y-06-12 06:45:00", 'input' => '12.6. 6:45'],
['expected' => '2024-06-12 06:45:00', 'input' => '12.6.2024 6:45'],
['expected' => '2023-06-11 07:00:00', 'input' => '2023-06-11 7:00'],
];
Expand Down

0 comments on commit 1047081

Please sign in to comment.