Skip to content

Commit

Permalink
Add unit test for parsing a zero duration
Browse files Browse the repository at this point in the history
  • Loading branch information
phil-davis committed Nov 9, 2023
1 parent 75675b5 commit 1afdbb5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/VObject/DateTimeParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ public function testParseICalendarDurationDateInterval()
$this->assertEquals($expected, DateTimeParser::parseDuration('-PT3M'));
}

public function testParseDurationZero()
{
$expected = new \DateInterval('PT0S');
self::assertEquals($expected, DateTimeParser::parseDuration('P'));
}

public function testParseICalendarDurationFail()
{
$this->expectException(InvalidDataException::class);
Expand Down

0 comments on commit 1afdbb5

Please sign in to comment.