Skip to content

Commit

Permalink
Added spec for Italian translations
Browse files Browse the repository at this point in the history
  • Loading branch information
norberttech committed Oct 26, 2015
1 parent 0db6f5d commit c00b059
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions spec/Coduo/PHPHumanizer/DateTimeSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,4 +171,22 @@ function it_humanizes_precise_difference_between_dates_for_pt_BR_locale()
$this->preciseDifference(new \DateTime($example[0]), new \DateTime($example[1]), 'pt_BR')->shouldReturn($example[2]);
}
}

function it_humanizes_precise_difference_between_dates_for_it_locale()
{
$examples = array(
array("2014-04-26 13:00:00", "2014-04-26 12:58:15", '1 minuto, 45 secondi fa'),
array("2014-04-26 13:00:00", "2014-04-26 11:20:00", '1 ora, 40 minuti fa'),
array("2014-04-26 13:00:00", "2014-04-27 13:15:00", '1 giorno, 15 minuti da adesso'),
array("2014-04-26 13:00:00", "2014-05-03 15:00:00", '7 giorni, 2 ore da adesso'),
array("2014-04-26 13:00:00", "2015-04-28 17:00:00", '1 anno, 2 giorni, 4 ore da adesso'),
array("2014-04-26 13:00:00", "2014-04-28 23:00:00", '2 giorni, 10 ore da adesso'),
array("2014-04-26 13:00:00", "2014-04-25 11:20:00", '1 giorno, 1 ora, 40 minuti fa'),
array("2014-04-26 13:00:00", "2016-04-27 13:00:00", '2 anni, 1 giorno da adesso'),
);

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

0 comments on commit c00b059

Please sign in to comment.