From baeb9ba72ef0ce2de85e83ad4d5192943bf6029c Mon Sep 17 00:00:00 2001 From: Joshua Ramon Enslin Date: Sun, 27 Sep 2020 12:40:15 +0200 Subject: [PATCH] Add test assertion for splitting international dates --- tests/NodaTimeSplitterTest.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/NodaTimeSplitterTest.php b/tests/NodaTimeSplitterTest.php index 9901c96..9f41666 100644 --- a/tests/NodaTimeSplitterTest.php +++ b/tests/NodaTimeSplitterTest.php @@ -241,6 +241,18 @@ final class NodaTimeSplitterTest extends TestCase { self::assertEquals(NodaTimeSplitter::timePartsToTimeName($output), "02.01.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"); self::assertEquals($output, [ 0 => "1920",