From fe627259db2d4a577744c9834664c440ec478776 Mon Sep 17 00:00:00 2001 From: Dave Smith-Hayes Date: Fri, 15 Nov 2024 02:44:49 +0000 Subject: [PATCH] Test many permutations of the duration parser. --- app/tests/Domain/Entity/EpisodeTest.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/app/tests/Domain/Entity/EpisodeTest.php b/app/tests/Domain/Entity/EpisodeTest.php index 29e9c3e..0e3e84c 100644 --- a/app/tests/Domain/Entity/EpisodeTest.php +++ b/app/tests/Domain/Entity/EpisodeTest.php @@ -16,6 +16,17 @@ class EpisodeTest extends TestCase $r = Episode::parseDurationFromLength($oneHourThirtyMinutes); $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); + } }