Add tests for splitting common historical month names
This commit is contained in:
parent
3ed218fbac
commit
e91dfbf3ef
|
@ -180,6 +180,30 @@ final class NodaTimeSplitterTest extends TestCase {
|
||||||
self::assertEquals(NodaTimeSplitter::timePartsToTimeName($output), "Nach Januar 2020");
|
self::assertEquals(NodaTimeSplitter::timePartsToTimeName($output), "Nach Januar 2020");
|
||||||
self::assertEquals(NodaTimeSplitter::timePartsToCountingYear($output), 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");
|
$output = NodaTimeSplitter::attempt_splitting("Nach 60er Jahre");
|
||||||
self::assertEquals($output, [
|
self::assertEquals($output, [
|
||||||
0 => "1970",
|
0 => "1970",
|
||||||
|
|
Loading…
Reference in New Issue
Block a user