jenkins-bot has submitted this change and it was merged.

Change subject: Test years with leading zeros in DateTimeParserTest
......................................................................


Test years with leading zeros in DateTimeParserTest

The special handling for years with 5 and more digits is, well, special.
Better add some tests to make sure future refactoring doesn't mess up
things.

Change-Id: I33eede7e3565ebdca66be0bce753100ccceacf6a
---
M lib/tests/phpunit/parsers/DateTimeParserTest.php
1 file changed, 11 insertions(+), 0 deletions(-)

Approvals:
  Daniel Kinzler: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/lib/tests/phpunit/parsers/DateTimeParserTest.php 
b/lib/tests/phpunit/parsers/DateTimeParserTest.php
index 51f7e7a..d615657 100644
--- a/lib/tests/phpunit/parsers/DateTimeParserTest.php
+++ b/lib/tests/phpunit/parsers/DateTimeParserTest.php
@@ -18,6 +18,7 @@
  *
  * @licence GNU GPL v2+
  * @author Adam Shorland
+ * @author Thiemo Mättig
  */
 class DateTimeParserTest extends StringValueParserTest {
 
@@ -147,6 +148,16 @@
                        '-10100-02-29' =>
                                array( '-0000000000010100-03-01T00:00:00Z', 0 , 
0 , 0 , TimeValue::PRECISION_DAY , TimeFormatter::CALENDAR_GREGORIAN ),
 
+                       // Years with leading zeros
+                       '4th July 00000002015' =>
+                               array( '+0000000000002015-07-04T00:00:00Z', 0 , 
0 , 0 , TimeValue::PRECISION_DAY , TimeFormatter::CALENDAR_GREGORIAN ),
+                       '00000002015-07-04' =>
+                               array( '+0000000000002015-07-04T00:00:00Z', 0 , 
0 , 0 , TimeValue::PRECISION_DAY , TimeFormatter::CALENDAR_GREGORIAN ),
+                       '4th July 00000092015' =>
+                               array( '+0000000000092015-07-04T00:00:00Z', 0 , 
0 , 0 , TimeValue::PRECISION_DAY , TimeFormatter::CALENDAR_GREGORIAN ),
+                       '00000092015-07-04' =>
+                               array( '+0000000000092015-07-04T00:00:00Z', 0 , 
0 , 0 , TimeValue::PRECISION_DAY , TimeFormatter::CALENDAR_GREGORIAN ),
+
                        //Testing Leap Year stuff
                        '10000-02-29' =>
                                array( '+0000000000010000-02-29T00:00:00Z', 0 , 
0 , 0 , TimeValue::PRECISION_DAY , TimeFormatter::CALENDAR_GREGORIAN ),

-- 
To view, visit https://gerrit.wikimedia.org/r/192297
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I33eede7e3565ebdca66be0bce753100ccceacf6a
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) <[email protected]>
Gerrit-Reviewer: Daniel Kinzler <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to