We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a6c7e72 commit 5ea5231Copy full SHA for 5ea5231
1 file changed
tests/unit/Helper/DurationConverterTest.php
@@ -39,4 +39,15 @@ public function shouldConvertDurationToYearSuccessfully() : void
39
$result = DurationConverter::toYear($duration);
40
$this->assertEquals($expected, $result);
41
}
42
+
43
+ /**
44
+ * @test
45
+ */
46
+ public function shouldConvertDurationToMonthSuccessfully() : void
47
+ {
48
+ $duration = 'P0Y9M4DT1H5M0S';
49
+ $expected = round( 9*30/365 + 4/365 + 1/365/60 + 5/365/60/60, 2);
50
+ $result = DurationConverter::toYear($duration);
51
+ $this->assertEquals($expected, $result);
52
+ }
53
0 commit comments