Skip to content

Commit 9c6a599

Browse files
committed
Added German locale specs
1 parent a912178 commit 9c6a599

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
@@ -99,4 +99,22 @@ function it_humanizes_precise_difference_between_dates_for_pl_locale()
9999
$this->preciseDifference(new \DateTime($example[0]), new \DateTime($example[1]), 'pl')->shouldReturn($example[2]);
100100
}
101101
}
102+
103+
function it_humanizes_precise_difference_between_dates_for_de_locale()
104+
{
105+
$examples = array(
106+
array("2014-04-26 13:00:00", "2014-04-26 12:58:15", '1 Minute, 45 Sekunden vor'),
107+
array("2014-04-26 13:00:00", "2014-04-26 11:20:00", '1 Stunde, 40 Minuten vor'),
108+
array("2014-04-26 13:00:00", "2014-04-27 13:15:00", '1 Tag, 15 Minuten ab jetzt'),
109+
array("2014-04-26 13:00:00", "2014-05-03 15:00:00", '7 Tage, 2 Stunden ab jetzt'),
110+
array("2014-04-26 13:00:00", "2015-04-28 17:00:00", '1 Jahr, 2 Tage, 4 Stunden ab jetzt'),
111+
array("2014-04-26 13:00:00", "2014-04-28 23:00:00", '2 Tage, 10 Stunden ab jetzt'),
112+
array("2014-04-26 13:00:00", "2014-04-25 11:20:00", '1 Tag, 1 Stunde, 40 Minuten vor'),
113+
array("2014-04-26 13:00:00", "2016-04-27 13:00:00", '2 Jahre, 1 Tag ab jetzt'),
114+
);
115+
116+
foreach ($examples as $example) {
117+
$this->preciseDifference(new \DateTime($example[0]), new \DateTime($example[1]), 'de')->shouldReturn($example[2]);
118+
}
119+
}
102120
}

0 commit comments

Comments
 (0)