Ensure times can be split despite spaces at random points in given name
This commit is contained in:
parent
16f36c0852
commit
eb371d4270
|
@ -476,6 +476,19 @@ final class NodaTimeSplitterTest extends TestCase {
|
|||
self::assertEquals($output->toTimeName(), "Bis 1801 v. Chr.");
|
||||
self::assertEquals(NodaTimeSplitter::timePartsToCountingYear($output), 1801);
|
||||
|
||||
$output = NodaTimeSplitter::attempt_splitting("15. 11. 1978");
|
||||
self::assertNotEmpty($output);
|
||||
self::assertEquals($output->toOldFormat(), [
|
||||
0 => "1978",
|
||||
1 => "1978",
|
||||
2 => "11",
|
||||
3 => "15",
|
||||
4 => "+",
|
||||
5 => "",
|
||||
]);
|
||||
self::assertEquals($output->toTimeName(), "15.11.1978");
|
||||
self::assertEquals(NodaTimeSplitter::timePartsToCountingYear($output), 1978);
|
||||
|
||||
$output = NodaTimeSplitter::attempt_splitting("6 November 1978");
|
||||
self::assertNotEmpty($output);
|
||||
self::assertEquals($output->toOldFormat(), [
|
||||
|
|
Loading…
Reference in New Issue
Block a user