Add test assertion for splitting international dates

This commit is contained in:
Joshua Ramon Enslin 2020-09-27 12:40:15 +02:00 committed by Stefan Rohde-Enslin
parent de7968fbbd
commit baeb9ba72e

View File

@ -241,6 +241,18 @@ final class NodaTimeSplitterTest extends TestCase {
self::assertEquals(NodaTimeSplitter::timePartsToTimeName($output), "02.01.2020"); self::assertEquals(NodaTimeSplitter::timePartsToTimeName($output), "02.01.2020");
self::assertEquals(NodaTimeSplitter::timePartsToCountingYear($output), 2020); self::assertEquals(NodaTimeSplitter::timePartsToCountingYear($output), 2020);
$output = NodaTimeSplitter::attempt_splitting("2020-01-02");
self::assertEquals($output, [
0 => "2020",
1 => "2020",
2 => "01",
3 => "02",
4 => "+",
5 => "",
]);
self::assertEquals(NodaTimeSplitter::timePartsToTimeName($output), "02.01.2020");
self::assertEquals(NodaTimeSplitter::timePartsToCountingYear($output), 2020);
$output = NodaTimeSplitter::attempt_splitting("1920-tól 1929-ig"); $output = NodaTimeSplitter::attempt_splitting("1920-tól 1929-ig");
self::assertEquals($output, [ self::assertEquals($output, [
0 => "1920", 0 => "1920",