Skip to content

Commit

Permalink
Added specs for FR translations
Browse files Browse the repository at this point in the history
  • Loading branch information
norberttech committed Oct 26, 2015
1 parent 6051e89 commit c6a594a
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion spec/Coduo/PHPHumanizer/DateTimeSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ function it_humanizes_precise_difference_between_dates_for_de_locale()
}
}


function it_humanizes_precise_difference_between_dates_for_tr_locale()
{
$examples = array(
Expand All @@ -136,4 +135,22 @@ function it_humanizes_precise_difference_between_dates_for_tr_locale()
$this->preciseDifference(new \DateTime($example[0]), new \DateTime($example[1]), 'tr')->shouldReturn($example[2]);
}
}

function it_humanizes_precise_difference_between_dates_for_fr_locale()
{
$examples = array(
array("2014-04-26 13:00:00", "2014-04-26 12:58:15", '1 minute, 45 secondes il y\'a'),
array("2014-04-26 13:00:00", "2014-04-26 11:20:00", '1 heure, 40 minutes il y\'a'),
array("2014-04-26 13:00:00", "2014-04-27 13:15:00", '1 jour, 15 minutes maintenant'),
array("2014-04-26 13:00:00", "2014-05-03 15:00:00", '7 jours, 2 heures maintenant'),
array("2014-04-26 13:00:00", "2015-04-28 17:00:00", '1 année, 2 jours, 4 heures maintenant'),
array("2014-04-26 13:00:00", "2014-04-28 23:00:00", '2 jours, 10 heures maintenant'),
array("2014-04-26 13:00:00", "2014-04-25 11:20:00", '1 jour, 1 heure, 40 minutes il y\'a'),
array("2014-04-26 13:00:00", "2016-04-27 13:00:00", '2 années, 1 jour maintenant'),
);

foreach ($examples as $example) {
$this->preciseDifference(new \DateTime($example[0]), new \DateTime($example[1]), 'fr')->shouldReturn($example[2]);
}
}
}

0 comments on commit c6a594a

Please sign in to comment.