Test many permutations of the duration parser.

This commit is contained in:
Dave Smith-Hayes 2024-11-15 02:44:49 +00:00
parent d92fa75229
commit fe627259db

View File

@ -16,6 +16,17 @@ class EpisodeTest extends TestCase
$r = Episode::parseDurationFromLength($oneHourThirtyMinutes); $r = Episode::parseDurationFromLength($oneHourThirtyMinutes);
$this->assertEquals("01:30:00", $r); $this->assertEquals("01:30:00", $r);
}
$r = Episode::parseDurationFromLength($fortyNineMinutesEightSeconds);
$this->assertEquals("49:08", $r);
$r = Episode::parseDurationFromLength($fourMinutesTwentySeconds);
$this->assertEquals("04:20", $r); // nice!
$r = Episode::parseDurationFromLength($sixMinutesNineSeconds);
$this->assertEquals("06:09", $r); // nice!
$r = Episode::parseDurationFromLength($twentyThreeHoursFortyThreeMinutesTwelveSeconds);
$this->assertEquals("23:43:12", $r);
}
} }