Skip to content

Commit 5ea5231

Browse files
committed
DurationConverterTest coverage increased
1 parent a6c7e72 commit 5ea5231

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

tests/unit/Helper/DurationConverterTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,15 @@ public function shouldConvertDurationToYearSuccessfully() : void
3939
$result = DurationConverter::toYear($duration);
4040
$this->assertEquals($expected, $result);
4141
}
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+
}
4253
}

0 commit comments

Comments
 (0)