|
|
@ -32,13 +32,14 @@ class DateDifferenceTest extends TestCase |
|
|
/** @test */ |
|
|
/** @test */ |
|
|
public function date_difference_returns_proper_months_and_days_format() |
|
|
public function date_difference_returns_proper_months_and_days_format() |
|
|
{ |
|
|
{ |
|
|
// TODO: Need to fix, this should returns 1 months 9 days
|
|
|
|
|
|
$this->assertEquals('1 month 12 days', date_difference('2018-03-01', '2018-04-10', '%m month %d days')); |
|
|
|
|
|
|
|
|
//according to https://www.datecalculator.org/date-difference-between-dates
|
|
|
|
|
|
$this->assertEquals('1 month 9 days', date_difference('2018-03-01', '2018-04-10', '%m month %d days')); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** @test */ |
|
|
/** @test */ |
|
|
public function date_difference_returns_proper_years_months_and_days_format() |
|
|
public function date_difference_returns_proper_years_months_and_days_format() |
|
|
{ |
|
|
{ |
|
|
$this->assertEquals('1 year 1 month 12 days', date_difference('2017-03-01', '2018-04-10', '%y year %m month %d days')); |
|
|
|
|
|
|
|
|
//according to https://www.datecalculator.org/date-difference-between-dates
|
|
|
|
|
|
$this->assertEquals('1 year 1 month 9 days', date_difference('2017-03-01', '2018-04-10', '%y year %m month %d days')); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |