Add tests for splitting common historical month names

This commit is contained in:
Joshua Ramon Enslin 2022-04-12 23:47:08 +02:00
parent 3ed218fbac
commit e91dfbf3ef
Signed by: jrenslin
GPG Key ID: 46016F84501B70AE

View File

@ -180,6 +180,30 @@ final class NodaTimeSplitterTest extends TestCase {
self::assertEquals(NodaTimeSplitter::timePartsToTimeName($output), "Nach Januar 2020");
self::assertEquals(NodaTimeSplitter::timePartsToCountingYear($output), 2020);
$output = NodaTimeSplitter::attempt_splitting("Januar 2020");
self::assertEquals($output, [
0 => "2020",
1 => "2020",
2 => "01",
3 => "00",
4 => "+",
5 => "",
]);
self::assertEquals(NodaTimeSplitter::timePartsToTimeName($output), "Januar 2020");
self::assertEquals(NodaTimeSplitter::timePartsToCountingYear($output), 2020);
$output = NodaTimeSplitter::attempt_splitting("Januar 1217");
self::assertEquals($output, [
0 => "1217",
1 => "1217",
2 => "01",
3 => "00",
4 => "+",
5 => "",
]);
self::assertEquals(NodaTimeSplitter::timePartsToTimeName($output), "Januar 1217");
self::assertEquals(NodaTimeSplitter::timePartsToCountingYear($output), 1217);
$output = NodaTimeSplitter::attempt_splitting("Nach 60er Jahre");
self::assertEquals($output, [
0 => "1970",