Aude has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/130340

Change subject: Add test cases for year time parsing
......................................................................

Add test cases for year time parsing

actual fix is in DataValues time component, but
added tests that things also work correctly in Wikibase
time parsers.

https://github.com/DataValues/Time/pull/16

Bug: 64537
Change-Id: Ib7c698de517d226dcbc89d4c9dacd09430eb0e19
---
M lib/tests/phpunit/parsers/TimeParserTest.php
M lib/tests/phpunit/parsers/YearTimeParserTest.php
2 files changed, 8 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/40/130340/1

diff --git a/lib/tests/phpunit/parsers/TimeParserTest.php 
b/lib/tests/phpunit/parsers/TimeParserTest.php
index d320362..d600cda 100644
--- a/lib/tests/phpunit/parsers/TimeParserTest.php
+++ b/lib/tests/phpunit/parsers/TimeParserTest.php
@@ -48,6 +48,10 @@
                        //Wikibase\Lib\YearTimeParser
                        '1999' =>
                                array( '+0000000000001999-00-00T00:00:00Z', 0 , 
0 , 0 , TimeValue::PRECISION_YEAR , TimeFormatter::CALENDAR_GREGORIAN ),
+                       '2000' =>
+                               array( '+0000000000002000-00-00T00:00:00Z', 0 , 
0 , 0 , TimeValue::PRECISION_YEAR , TimeFormatter::CALENDAR_GREGORIAN ),
+                       '2010' =>
+                               array( '+0000000000002010-00-00T00:00:00Z', 0 , 
0 , 0 , TimeValue::PRECISION_YEAR , TimeFormatter::CALENDAR_GREGORIAN ),
                        '1' =>
                                array( '+0000000000000001-00-00T00:00:00Z', 0 , 
0 , 0 , TimeValue::PRECISION_YEAR , TimeFormatter::CALENDAR_GREGORIAN ),
                        '-1000000001' =>
@@ -94,7 +98,6 @@
                                array( '-0000000000002013-07-01T00:00:00Z', 0 , 
0 , 0 , TimeValue::PRECISION_DAY , TimeFormatter::CALENDAR_GREGORIAN ),
                        '-10100-02-29' =>
                                array( '-0000000000010100-03-01T00:00:00Z', 0 , 
0 , 0 , TimeValue::PRECISION_DAY , TimeFormatter::CALENDAR_GREGORIAN ),
-
                );
 
                foreach ( $valid as $value => $expected ) {
diff --git a/lib/tests/phpunit/parsers/YearTimeParserTest.php 
b/lib/tests/phpunit/parsers/YearTimeParserTest.php
index 36a1777..d6ab814 100644
--- a/lib/tests/phpunit/parsers/YearTimeParserTest.php
+++ b/lib/tests/phpunit/parsers/YearTimeParserTest.php
@@ -62,6 +62,10 @@
                $valid = array(
                        '1999' =>
                                array( '+0000000000001999-00-00T00:00:00Z', 0 , 
0 , 0 , TimeValue::PRECISION_YEAR , TimeFormatter::CALENDAR_GREGORIAN ),
+                       '2000' =>
+                               array( '+0000000000002000-00-00T00:00:00Z', 0 , 
0 , 0 , TimeValue::PRECISION_YEAR , TimeFormatter::CALENDAR_GREGORIAN ),
+                       '2010' =>
+                               array( '+0000000000002010-00-00T00:00:00Z', 0 , 
0 , 0 , TimeValue::PRECISION_YEAR , TimeFormatter::CALENDAR_GREGORIAN ),
                        '2000000' =>
                                array( '+0000000002000000-00-00T00:00:00Z', 0 , 
0 , 0 , TimeValue::PRECISION_Ma , TimeFormatter::CALENDAR_GREGORIAN ),
                        '2000000000' =>

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib7c698de517d226dcbc89d4c9dacd09430eb0e19
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: mw1.24-wmf2
Gerrit-Owner: Aude <aude.w...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to