Commit 0cb6458e authored by Anton Smirnov's avatar Anton Smirnov
Browse files

Test range exception in the parser

parent 25788813
Loading
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -137,6 +137,16 @@ class IsoWeekTest extends TestCase
        IsoWeekCalendar::create(2020, 54, 5);
    }

    public function testRangeMonthParser(): void
    {
        $this->expectException(\UnexpectedValueException::class);
        $this->expectExceptionMessage(
            'Unable to parse the date string: "2024-W54-5". For year 2024, week must be in range 1-52'
        );

        IsoWeekCalendar::parse('2024-W54-5');
    }

    public function testRangeMonthLeap(): void
    {
        $date = IsoWeekCalendar::create(2020, 53, 5);