Skip to content

Commit a23b8e5

Browse files
author
Norbert Orzechowicz
committed
Merge pull request #15 from norzechowicz/italian-translations-spec
Added spec for Italian translations
2 parents 0db6f5d + c00b059 commit a23b8e5

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

spec/Coduo/PHPHumanizer/DateTimeSpec.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,4 +171,22 @@ function it_humanizes_precise_difference_between_dates_for_pt_BR_locale()
171171
$this->preciseDifference(new \DateTime($example[0]), new \DateTime($example[1]), 'pt_BR')->shouldReturn($example[2]);
172172
}
173173
}
174+
175+
function it_humanizes_precise_difference_between_dates_for_it_locale()
176+
{
177+
$examples = array(
178+
array("2014-04-26 13:00:00", "2014-04-26 12:58:15", '1 minuto, 45 secondi fa'),
179+
array("2014-04-26 13:00:00", "2014-04-26 11:20:00", '1 ora, 40 minuti fa'),
180+
array("2014-04-26 13:00:00", "2014-04-27 13:15:00", '1 giorno, 15 minuti da adesso'),
181+
array("2014-04-26 13:00:00", "2014-05-03 15:00:00", '7 giorni, 2 ore da adesso'),
182+
array("2014-04-26 13:00:00", "2015-04-28 17:00:00", '1 anno, 2 giorni, 4 ore da adesso'),
183+
array("2014-04-26 13:00:00", "2014-04-28 23:00:00", '2 giorni, 10 ore da adesso'),
184+
array("2014-04-26 13:00:00", "2014-04-25 11:20:00", '1 giorno, 1 ora, 40 minuti fa'),
185+
array("2014-04-26 13:00:00", "2016-04-27 13:00:00", '2 anni, 1 giorno da adesso'),
186+
);
187+
188+
foreach ($examples as $example) {
189+
$this->preciseDifference(new \DateTime($example[0]), new \DateTime($example[1]), 'it')->shouldReturn($example[2]);
190+
}
191+
}
174192
}

0 commit comments

Comments
 (0)