Skip to content

Commit c6a594a

Browse files
committed
Added specs for FR translations
1 parent 6051e89 commit c6a594a

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

spec/Coduo/PHPHumanizer/DateTimeSpec.php

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ function it_humanizes_precise_difference_between_dates_for_de_locale()
118118
}
119119
}
120120

121-
122121
function it_humanizes_precise_difference_between_dates_for_tr_locale()
123122
{
124123
$examples = array(
@@ -136,4 +135,22 @@ function it_humanizes_precise_difference_between_dates_for_tr_locale()
136135
$this->preciseDifference(new \DateTime($example[0]), new \DateTime($example[1]), 'tr')->shouldReturn($example[2]);
137136
}
138137
}
138+
139+
function it_humanizes_precise_difference_between_dates_for_fr_locale()
140+
{
141+
$examples = array(
142+
array("2014-04-26 13:00:00", "2014-04-26 12:58:15", '1 minute, 45 secondes il y\'a'),
143+
array("2014-04-26 13:00:00", "2014-04-26 11:20:00", '1 heure, 40 minutes il y\'a'),
144+
array("2014-04-26 13:00:00", "2014-04-27 13:15:00", '1 jour, 15 minutes maintenant'),
145+
array("2014-04-26 13:00:00", "2014-05-03 15:00:00", '7 jours, 2 heures maintenant'),
146+
array("2014-04-26 13:00:00", "2015-04-28 17:00:00", '1 année, 2 jours, 4 heures maintenant'),
147+
array("2014-04-26 13:00:00", "2014-04-28 23:00:00", '2 jours, 10 heures maintenant'),
148+
array("2014-04-26 13:00:00", "2014-04-25 11:20:00", '1 jour, 1 heure, 40 minutes il y\'a'),
149+
array("2014-04-26 13:00:00", "2016-04-27 13:00:00", '2 années, 1 jour maintenant'),
150+
);
151+
152+
foreach ($examples as $example) {
153+
$this->preciseDifference(new \DateTime($example[0]), new \DateTime($example[1]), 'fr')->shouldReturn($example[2]);
154+
}
155+
}
139156
}

0 commit comments

Comments
 (0)