jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/377045 )
Change subject: New Wikidata Build - 2017-09-10T10:00:01+0000 ...................................................................... New Wikidata Build - 2017-09-10T10:00:01+0000 Change-Id: I20e912662da9e8e326cad8d82aad4fb5b0a9e625 --- M composer.lock M extensions/Constraints/i18n/pl.json M extensions/Wikibase/client/i18n/ais.json M extensions/Wikibase/lib/i18n/ais.json M extensions/Wikibase/repo/i18n/ais.json M extensions/Wikibase/repo/i18n/ne.json M vendor/composer/installed.json M vendor/data-values/common/Common.php D vendor/data-values/time/.gitignore D vendor/data-values/time/.scrutinizer.yml D vendor/data-values/time/.travis.yml M vendor/data-values/time/README.md M vendor/data-values/time/Time.php D vendor/data-values/time/composer.json D vendor/data-values/time/phpunit.xml.dist M vendor/data-values/time/src/DataValues/TimeValue.php M vendor/data-values/time/src/ValueParsers/IsoTimestampParser.php M vendor/data-values/time/src/ValueParsers/MonolingualMonthNameProvider.php M vendor/data-values/time/src/ValueParsers/MonthNameUnlocalizer.php M vendor/data-values/time/src/ValueParsers/PhpDateTimeParser.php M vendor/data-values/time/src/ValueParsers/YearMonthTimeParser.php M vendor/data-values/time/src/ValueParsers/YearTimeParser.php D vendor/data-values/time/tests/DataValues/TimeValueCalculatorTest.php D vendor/data-values/time/tests/DataValues/TimeValueTest.php D vendor/data-values/time/tests/ValueFormatters/TimeFormatterTest.php D vendor/data-values/time/tests/ValueParsers/CalendarModelParserTest.php D vendor/data-values/time/tests/ValueParsers/EraParserTest.php D vendor/data-values/time/tests/ValueParsers/IsoTimestampParserTest.php D vendor/data-values/time/tests/ValueParsers/MonolingualMonthNameProviderTest.php D vendor/data-values/time/tests/ValueParsers/MonthNameUnlocalizerTest.php D vendor/data-values/time/tests/ValueParsers/PhpDateTimeParserTest.php D vendor/data-values/time/tests/ValueParsers/YearMonthDayTimeParserTest.php D vendor/data-values/time/tests/ValueParsers/YearMonthTimeParserTest.php D vendor/data-values/time/tests/ValueParsers/YearTimeParserTest.php D vendor/data-values/time/tests/bootstrap.php 35 files changed, 154 insertions(+), 2,660 deletions(-) Approvals: Aude: Looks good to me, approved jenkins-bot: Verified diff --git a/composer.lock b/composer.lock index adf5635..da2b0a2 100644 --- a/composer.lock +++ b/composer.lock @@ -126,16 +126,16 @@ }, { "name": "data-values/common", - "version": "0.4.0", + "version": "0.4.1", "source": { "type": "git", "url": "https://github.com/DataValues/Common.git", - "reference": "0fb269955b464e54f7ca3d514e012283d48228a5" + "reference": "7b11237246ce4e4fcc59e0138d7942278a7df802" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/DataValues/Common/zipball/0fb269955b464e54f7ca3d514e012283d48228a5", - "reference": "0fb269955b464e54f7ca3d514e012283d48228a5", + "url": "https://api.github.com/repos/DataValues/Common/zipball/7b11237246ce4e4fcc59e0138d7942278a7df802", + "reference": "7b11237246ce4e4fcc59e0138d7942278a7df802", "shasum": "" }, "require": { @@ -183,7 +183,7 @@ "valuevalidators", "wikidata" ], - "time": "2017-08-09 17:20:43" + "time": "2017-08-09 18:20:52" }, { "name": "data-values/data-types", @@ -592,23 +592,27 @@ }, { "name": "data-values/time", - "version": "0.8.5", + "version": "0.8.6", "source": { "type": "git", "url": "https://github.com/DataValues/Time.git", - "reference": "74992e8d7c81bb8adcc1a606f19231fc72ad994a" + "reference": "92f768e90d2ec10bb70b7e631dbb268e803d3fe8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/DataValues/Time/zipball/74992e8d7c81bb8adcc1a606f19231fc72ad994a", - "reference": "74992e8d7c81bb8adcc1a606f19231fc72ad994a", + "url": "https://api.github.com/repos/DataValues/Time/zipball/92f768e90d2ec10bb70b7e631dbb268e803d3fe8", + "reference": "92f768e90d2ec10bb70b7e631dbb268e803d3fe8", "shasum": "" }, "require": { "data-values/common": "~0.4.0|~0.3.0|~0.2.0", "data-values/data-values": "~1.0|~0.1", "data-values/interfaces": "~0.2.0|~0.1.5", - "php": ">=5.3.0" + "php": ">=5.5.9" + }, + "require-dev": { + "phpunit/phpunit": "~4.8", + "wikibase/wikibase-codesniffer": "^0.1.0" }, "type": "library", "extra": { @@ -645,7 +649,7 @@ "valueparsers", "wikidata" ], - "time": "2017-08-09 19:45:30" + "time": "2017-09-06 09:54:50" }, { "name": "data-values/value-view", @@ -973,7 +977,7 @@ "source": { "type": "git", "url": "https://gerrit.wikimedia.org/r/mediawiki/extensions/WikibaseQualityConstraints", - "reference": "62b2cc6e53224b35312ee184b0dd66da310a83b3" + "reference": "2a4ac4a68fefdca614aebc5008f9f6e0474090c4" }, "require": { "php": ">=5.5.9", @@ -1033,7 +1037,7 @@ "support": { "issues": "https://phabricator.wikimedia.org/project/profile/1202/" }, - "time": "2017-09-08 22:23:33" + "time": "2017-09-09 20:54:48" }, { "name": "wikibase/data-model", @@ -1544,12 +1548,12 @@ "source": { "type": "git", "url": "https://github.com/wikimedia/mediawiki-extensions-Wikibase.git", - "reference": "05032fcf4bcf8ac17dbd7498025a31c6f243a4db" + "reference": "a83dc42f04ad131ea63b16f99e695e910ddd60cf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/05032fcf4bcf8ac17dbd7498025a31c6f243a4db", - "reference": "05032fcf4bcf8ac17dbd7498025a31c6f243a4db", + "url": "https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/a83dc42f04ad131ea63b16f99e695e910ddd60cf", + "reference": "a83dc42f04ad131ea63b16f99e695e910ddd60cf", "shasum": "" }, "require": { @@ -1626,7 +1630,7 @@ "wikibaserepo", "wikidata" ], - "time": "2017-09-08 22:23:10" + "time": "2017-09-09 20:54:28" }, { "name": "wikibase/wikimedia-badges", diff --git a/extensions/Constraints/i18n/pl.json b/extensions/Constraints/i18n/pl.json index bcc5abb..f9aa43e 100644 --- a/extensions/Constraints/i18n/pl.json +++ b/extensions/Constraints/i18n/pl.json @@ -15,6 +15,7 @@ "wbqc-constraintreport-result-table-header-status": "Status", "wbqc-constraintreport-no-parameter": "brak", "wbqc-badparameters-short": "Złe parametry", + "wbqc-constrainttypehelp-short": "Pomoc", "wbqc-violation-header-parameters": "Parametry:", "wbqc-violation-message-parameter-regex": "$1 nie jest prawidłowym wyrażeniem regularnym.", "wbqc-violation-message-diff-within-range-property-must-exist": "Właściwość określona w parametrach musi istnieć.", diff --git a/extensions/Wikibase/client/i18n/ais.json b/extensions/Wikibase/client/i18n/ais.json index e52214c..560e48f 100644 --- a/extensions/Wikibase/client/i18n/ais.json +++ b/extensions/Wikibase/client/i18n/ais.json @@ -12,8 +12,10 @@ "wikibase-editlinks": "mikawaway tu kalumyiti misiket", "wikibase-editlinkstitle": "mikawaway tu kalumyiti caliway han ku kamu misiket", "wikibase-linkitem-addlinks": "micunus tu masasiket", + "wikibase-linkitem-title": "masasiket tu kasabelih", "wikibase-linkitem-input-site": "kamu:", "wikibase-linkitem-input-page": "kasabelih:", + "wikibase-property-notfound": "$1 caykatepa ku susin", "wikibase-rc-hide-wikidata": "$1 {{WBREPONAME}}", "wikibase-rc-hide-wikidata-hide": "midimut", "wikibase-rc-hide-wikidata-show": "paazih", diff --git a/extensions/Wikibase/lib/i18n/ais.json b/extensions/Wikibase/lib/i18n/ais.json index 1b708d1..101b6f9 100644 --- a/extensions/Wikibase/lib/i18n/ais.json +++ b/extensions/Wikibase/lib/i18n/ais.json @@ -5,11 +5,15 @@ "Benel" ] }, + "wikibase-deletedentity-item": "masiputu tu kasacacay", + "wikibase-deletedentity-property": "masiputu tu susin", + "wikibase-deletedentity-query": "masiputu tu palalitemuh tu kawaw", "wikibase-quantitydetails-amount": "pulung", "wikibase-quantitydetails-upperbound": "sakapabaway a sausi", "wikibase-quantitydetails-lowerbound": "makasasa’ay a sausi", "wikibase-quantitydetails-unit": "sacacaycacay", "wikibase-timedetails-time": "tuki", + "wikibase-timedetails-timezone": "kakitizaan nu tatukian", "wikibase-timedetails-calendar": "kuyami", "wikibase-timedetails-before": "nuayawan", "wikibase-timedetails-after": "nazikuzan", @@ -18,11 +22,20 @@ "wikibase-globedetails-globe": "taenengan nu lala’-liwliw", "wikibase-sitelinks-wikipedia": "Wyici-payke", "wikibase-sitelinks-sitename-columnheading": "kamu", + "wikibase-snakview-snaktypeselector-somevalue": "caay kapulita ku sulyang", "wikibase-snakview-snaktypeselector-novalue": "inayi’ ku sulyang", "wikibase-tooltip-error-details": "pulitaay a kalunasulitan", + "wikibase-validator-invalid": "la’cusay a sulyang", + "wikibase-validator-no-such-entity": "caykatepa $1", "wikibase-validator-no-validators": "satezep", "datatypes-type-wikibase-item": "kasacacay", "datatypes-type-geo-shape": "hekal nu lala’-liwliw", + "wikibase-time-precision-millennium": "$1 malebut a mihca", + "wikibase-time-precision-century": "$1. lasubu a mihca", "wikibase-time-precision-10annum": "$1 kasamihca", - "wikibase-entity-summary-wbcreateclaim-create": "patizeng tu saleku" + "wikibase-entity-summary-wbcreateclaim-create": "patizeng tu saleku", + "wikibase-item-summary-wbeditentity-update": "masumad tuway kasacacay", + "wikibase-item-summary-wbeditentity-override": "palwpes tuway ku kasacacay", + "wikibase-property-summary-wbeditentity-update": "susin masumad tuway", + "wikibase-property-summary-wbeditentity-override": "palawpes tuway ku susin" } diff --git a/extensions/Wikibase/repo/i18n/ais.json b/extensions/Wikibase/repo/i18n/ais.json index 1d290ca..d0dba1e 100644 --- a/extensions/Wikibase/repo/i18n/ais.json +++ b/extensions/Wikibase/repo/i18n/ais.json @@ -13,17 +13,22 @@ "wikibase-save": "suped", "wikibase-cancel": "palawpes", "wikibase-add": "cunusen", + "wikibase-remove-inprogress": "misipu henay ayza", "wikibase-entitytermsview-entitytermsforlanguagelistview-configure-link-label": "setin", "wikibase-entitytermsforlanguagelistview-aliases": "u zuma a kamu sa", "wikibase-entitytermsforlanguagelistview-description": "patahkal", "wikibase-entitytermsforlanguagelistview-label": "aazihen paya", "wikibase-entitytermsforlanguagelistview-language": "kamu", + "wikibase-entitytermsforlanguagelistview-less": "caykayadahay a kamu", "wikibase-label-empty": "caay henay misaheci aazihen paya", "wikibase-label-edit-placeholder": "suliten tu aazihen a paya", "wikibase-description-empty": "caay henay misaheci ku patahkalay", "wikibase-description-edit-placeholder": "suliten tu sapuelac", "wikibase-content-language-edit-label": "kamu:", + "wikibase-diffview-reference": "miazih tu tatenga’ay nasulitan", "wikibase-diffview-rank": "kasaselel", + "wikibase-diffview-rank-preferred": "sakapahay a kasaselel", + "wikibase-diffview-rank-deprecated": "caay matatungus kasaselel", "wikibase-diffview-qualifier": "nikayadah a sulit", "wikibase-diffview-label": "aazihen paya", "wikibase-diffview-alias": "pacimilay a ngangan", @@ -34,18 +39,27 @@ "wikibase-sitelink-page-edit-placeholder": "kasabelih", "wikibase-alias-edit-placeholder": "suliten tu pacimilay a ngangan", "wikibase-statementsection-statements": "sapuelac", + "wikibase-sitelinks": "calay-kakacawan(wangcan) masasiket", "wikibase-sitelinks-special": "zuma wangcan", "wikibase-remove": "milimad", + "wikibase-move-up": "milimad tapabaw", + "wikibase-move-down": "milimad tasasa’", "wikibase-propertypage-datatype": "kalunasulitan a kakuniza", + "wikibase-statementview-rank-preferred": "sakapahay a kasaselel", "wikibase-statementview-rank-normal": "habutud kasaselel", + "wikibase-statementview-rank-deprecated": "caay matatungus kasaselel", + "wikibase-snakview-variations-somevalue-label": "caay kapulita ku sulyang", "wikibase-snakview-variations-novalue-label": "inayi’ ku sulyang", "wikibase-snakview-snaktypeselector-value": "pakuniza misanga’ay a sulyang", + "wikibase-snakformat-invalid-value": "la’cusay a sulyang.", + "wikibase-snakformat-propertynotfound": "caykatepa ku susin.", "wikibase-entityselector-more": "yadah", "wikibase-itembytitle-lookup-site": "calay-kakacawan(wangcan):", "wikibase-itembytitle-lookup-page": "kasabelih:", "wikibase-itembytitle-submit": "kilim", "wikibase-gotolinkedpage-lookup-site": "calay-kakacawan(wangcan):", "wikibase-gotolinkedpage-submit": "taayaw", + "special-itemdisambiguation": "kasacacay caayay kalecad azihen", "wikibase-itemdisambiguation-lookup-language": "kamu a kodo:", "wikibase-itemdisambiguation-lookup-label": "aazihen paya:", "wikibase-itemdisambiguation-submit": "kilim", @@ -54,14 +68,22 @@ "wikibase-newentity-label": "aazihen paya:", "wikibase-newentity-description": "patahkal:", "wikibase-newentity-submit": "patizeng", + "special-setlabel": "setin aazihen a paya", "wikibase-setlabel-label": "aazihen paya:", "wikibase-setdescription-label": "patahkal:", + "wikibase-setdescription-submit": "setin sapuelac", + "special-setaliases": "setin pacimilay a ngangan", + "wikibase-setaliases-submit": "setin pacimilay a ngangan", "wikibase-setlabeldescriptionaliases-label-label": "aazihen paya:", "wikibase-setlabeldescriptionaliases-description-label": "patahkal:", "wikibase-setlabeldescriptionaliases-aliases-label": "pacimilay a ngangan:", + "wikibase-setsitelink-label": "calay-kakacawan(wangcan) masasiket:", "wikibase-setsitelink-badges": "kunpay:", "wikibase-modifyentity-id": "ID:", "wikibase-modifyterm-language": "kamu a kodo:", + "wikibase-mergeitems-submit": "mikabu tu kasacacay", + "wikibase-itemmerge-permissiondenied": "caykataneng ku tungus.", + "wikibase-itemmerge-no-such-entity": "caykatepa kasacacay.", "wikibase-dispatchstats-change-id": "ID", "wikibase-dispatchstats-oldest-change": "sakasumamadan", "wikibase-dispatchstats-newest-change": "sabaluhay", @@ -72,6 +94,8 @@ "wikibase-dispatchstats-large-lag": "satabakiay", "wikibase-dispatchstats-stalest": "samalumanay", "wikibase-dispatchstats-median": "myiti", + "special-listproperties": "piazihan tu sulit nu susin", + "wikibase-listproperties-datatype": "kalunasulitan a kakuniza:", "wikibase-listproperties-submit": "mikilim", "wikibase-entitieswithoutlabel-label-language": "kamu a kodo:", "wikibase-entitieswithoutlabel-label-type": "nikalahizaan:", @@ -83,9 +107,13 @@ "wikibase-listdatatypes-commonsmedia-head": "kasasimel tu myiti", "wikibase-listdatatypes-globe-coordinate-head": "taenengan nu lala’-liwliw", "wikibase-listdatatypes-geo-shape-head": "hekal nu lala’-liwliw", + "wikibase-listdatatypes-monolingualtext-head": "lacul nu cacay a kamu", + "wikibase-listdatatypes-multilingualtext-head": "lacul nu yada a kamu", "wikibase-listdatatypes-time-head": "tuki", "wikibase-listdatatypes-url-head": "URL", + "right-item-merge": "mikabu tu kasacacay", "right-property-create": "patizeng tu susin", + "action-item-merge": "mikabu tu kasacacay", "action-property-create": "patizeng tu susin", "wikibase-pageinfo-subscription-none": "nayi’" } diff --git a/extensions/Wikibase/repo/i18n/ne.json b/extensions/Wikibase/repo/i18n/ne.json index 81aedc2..5aeafc7 100644 --- a/extensions/Wikibase/repo/i18n/ne.json +++ b/extensions/Wikibase/repo/i18n/ne.json @@ -33,7 +33,7 @@ "wikibase-diffview-label": "नामपत्र", "wikibase-diffview-description": "विवरण", "wikibase-diffview-link": "लिङ्कहरू", - "wikibase-sitelink-site-edit-placeholder": "सन्दर्भ राख्ने", + "wikibase-sitelink-site-edit-placeholder": "विकि", "wikibase-sitelink-page-edit-placeholder": "पृष्ठ", "wikibase-sitelinks-special": "अन्य साइटहरू", "wikibase-remove": "हटाउने", diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index da7f006..8acf51d 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -1074,17 +1074,17 @@ }, { "name": "data-values/common", - "version": "0.4.0", - "version_normalized": "0.4.0.0", + "version": "0.4.1", + "version_normalized": "0.4.1.0", "source": { "type": "git", "url": "https://github.com/DataValues/Common.git", - "reference": "0fb269955b464e54f7ca3d514e012283d48228a5" + "reference": "7b11237246ce4e4fcc59e0138d7942278a7df802" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/DataValues/Common/zipball/0fb269955b464e54f7ca3d514e012283d48228a5", - "reference": "0fb269955b464e54f7ca3d514e012283d48228a5", + "url": "https://api.github.com/repos/DataValues/Common/zipball/7b11237246ce4e4fcc59e0138d7942278a7df802", + "reference": "7b11237246ce4e4fcc59e0138d7942278a7df802", "shasum": "" }, "require": { @@ -1092,7 +1092,7 @@ "data-values/interfaces": "~0.2.0|^0.1.5", "php": ">=5.3.0" }, - "time": "2017-08-09 17:20:43", + "time": "2017-08-09 18:20:52", "type": "library", "extra": { "branch-alias": { @@ -1137,26 +1137,30 @@ }, { "name": "data-values/time", - "version": "0.8.5", - "version_normalized": "0.8.5.0", + "version": "0.8.6", + "version_normalized": "0.8.6.0", "source": { "type": "git", "url": "https://github.com/DataValues/Time.git", - "reference": "74992e8d7c81bb8adcc1a606f19231fc72ad994a" + "reference": "92f768e90d2ec10bb70b7e631dbb268e803d3fe8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/DataValues/Time/zipball/74992e8d7c81bb8adcc1a606f19231fc72ad994a", - "reference": "74992e8d7c81bb8adcc1a606f19231fc72ad994a", + "url": "https://api.github.com/repos/DataValues/Time/zipball/92f768e90d2ec10bb70b7e631dbb268e803d3fe8", + "reference": "92f768e90d2ec10bb70b7e631dbb268e803d3fe8", "shasum": "" }, "require": { "data-values/common": "~0.4.0|~0.3.0|~0.2.0", "data-values/data-values": "~1.0|~0.1", "data-values/interfaces": "~0.2.0|~0.1.5", - "php": ">=5.3.0" + "php": ">=5.5.9" }, - "time": "2017-08-09 19:45:30", + "require-dev": { + "phpunit/phpunit": "~4.8", + "wikibase/wikibase-codesniffer": "^0.1.0" + }, + "time": "2017-09-06 09:54:50", "type": "library", "extra": { "branch-alias": { @@ -1385,12 +1389,12 @@ "source": { "type": "git", "url": "https://github.com/wikimedia/mediawiki-extensions-Wikibase.git", - "reference": "05032fcf4bcf8ac17dbd7498025a31c6f243a4db" + "reference": "a83dc42f04ad131ea63b16f99e695e910ddd60cf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/05032fcf4bcf8ac17dbd7498025a31c6f243a4db", - "reference": "05032fcf4bcf8ac17dbd7498025a31c6f243a4db", + "url": "https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/a83dc42f04ad131ea63b16f99e695e910ddd60cf", + "reference": "a83dc42f04ad131ea63b16f99e695e910ddd60cf", "shasum": "" }, "require": { @@ -1424,7 +1428,7 @@ "jakub-onderka/php-parallel-lint": ">=0.3 <0.10", "wikibase/wikibase-codesniffer": "^0.1.0" }, - "time": "2017-09-08 22:23:10", + "time": "2017-09-09 20:54:28", "type": "mediawiki-extension", "installation-source": "dist", "autoload": { @@ -1775,7 +1779,7 @@ "source": { "type": "git", "url": "https://gerrit.wikimedia.org/r/mediawiki/extensions/WikibaseQualityConstraints", - "reference": "62b2cc6e53224b35312ee184b0dd66da310a83b3" + "reference": "2a4ac4a68fefdca614aebc5008f9f6e0474090c4" }, "require": { "php": ">=5.5.9", @@ -1791,7 +1795,7 @@ "satooshi/php-coveralls": "master-dev", "wikibase/wikibase-codesniffer": "^0.1.0" }, - "time": "2017-09-08 22:23:33", + "time": "2017-09-09 20:54:48", "type": "mediawiki-extension", "installation-source": "source", "autoload": { diff --git a/vendor/data-values/common/Common.php b/vendor/data-values/common/Common.php index a760de2..7daee7e 100644 --- a/vendor/data-values/common/Common.php +++ b/vendor/data-values/common/Common.php @@ -15,4 +15,4 @@ return 1; } -define( 'DATAVALUES_COMMON_VERSION', '0.3.1' ); +define( 'DATAVALUES_COMMON_VERSION', '0.4.1' ); diff --git a/vendor/data-values/time/.gitignore b/vendor/data-values/time/.gitignore deleted file mode 100644 index 577795c..0000000 --- a/vendor/data-values/time/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -*~ -*.kate-swp -*.swp - -!.* - -.idea/ -build/ -vendor/ - -composer.phar -composer.lock \ No newline at end of file diff --git a/vendor/data-values/time/.scrutinizer.yml b/vendor/data-values/time/.scrutinizer.yml deleted file mode 100644 index d6c0c6b..0000000 --- a/vendor/data-values/time/.scrutinizer.yml +++ /dev/null @@ -1,13 +0,0 @@ -build: true -inherit: true - -tools: - php_code_coverage: true - php_code_sniffer: true - php_cpd: true - php_cs_fixer: true - php_loc: true - php_mess_detector: true - php_pdepend: true - php_analyzer: true - sensiolabs_security_checker: true diff --git a/vendor/data-values/time/.travis.yml b/vendor/data-values/time/.travis.yml deleted file mode 100644 index 29da81f..0000000 --- a/vendor/data-values/time/.travis.yml +++ /dev/null @@ -1,19 +0,0 @@ -language: php - -php: - - 5.3 - - 5.4 - - 5.5 - - 5.6 - - 7 - - hhvm - -before_script: - - composer install --prefer-source - -script: - - phpunit - -cache: - directories: - - $HOME/.composer/cache diff --git a/vendor/data-values/time/README.md b/vendor/data-values/time/README.md index 0a17d3b..0e2d882 100644 --- a/vendor/data-values/time/README.md +++ b/vendor/data-values/time/README.md @@ -52,6 +52,15 @@ ## Release notes +### 0.8.6 (2017-09-06) + +* Added whitespace trimming to `YearTimeParser`. +* Fixed `IsoTimestampParser` and `TimeValue` accepting a time of day with no day. +* Fixed `MonthNameUnlocalizer` accidentally replacing already unlocalized numeric months. +* Fixed `PhpDateTimeParser` misinterpreting inputs with only one or two numbers. +* Deprecated `TimeValue::newFromArray`. +* Raised required PHP version from 5.3 to 5.5. + ### 0.8.5 (2017-08-09) * Removed MediaWiki integration diff --git a/vendor/data-values/time/Time.php b/vendor/data-values/time/Time.php index bfa5c65..222317c 100644 --- a/vendor/data-values/time/Time.php +++ b/vendor/data-values/time/Time.php @@ -15,5 +15,4 @@ return 1; } -define( 'DATAVALUES_TIME_VERSION', '0.8.5' ); - +define( 'DATAVALUES_TIME_VERSION', '0.8.6' ); diff --git a/vendor/data-values/time/composer.json b/vendor/data-values/time/composer.json deleted file mode 100644 index db95f4f..0000000 --- a/vendor/data-values/time/composer.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "data-values/time", - "type": "library", - "description": "Time value objects, parsers and formatters", - "keywords": [ - "datavalues", - "valueparsers", - "valueformatters", - "wikidata", - "time" - ], - "homepage": "https://github.com/DataValues/Time", - "license": "GPL-2.0+", - "authors": [ - { - "name": "The Wikidata team", - "role": "Developer" - } - ], - "support": { - "irc": "irc://irc.freenode.net/wikidata" - }, - "require": { - "php": ">=5.3.0", - "data-values/data-values": "~1.0|~0.1", - "data-values/interfaces": "~0.2.0|~0.1.5", - "data-values/common": "~0.4.0|~0.3.0|~0.2.0" - }, - "autoload": { - "files" : [ - "Time.php" - ], - "psr-0": { - "DataValues\\": "src", - "ValueFormatters\\": "src", - "ValueParsers\\": "src" - } - }, - "extra": { - "branch-alias": { - "dev-master": "0.8.x-dev" - } - } -} diff --git a/vendor/data-values/time/phpunit.xml.dist b/vendor/data-values/time/phpunit.xml.dist deleted file mode 100644 index 710128a..0000000 --- a/vendor/data-values/time/phpunit.xml.dist +++ /dev/null @@ -1,24 +0,0 @@ -<phpunit backupGlobals="false" - backupStaticAttributes="false" - bootstrap="tests/bootstrap.php" - cacheTokens="false" - colors="true" - convertErrorsToExceptions="true" - convertNoticesToExceptions="true" - convertWarningsToExceptions="true" - stopOnError="false" - stopOnFailure="false" - stopOnIncomplete="false" - stopOnSkipped="false" - verbose="true"> - <testsuites> - <testsuite name="DataValuesTime"> - <directory>tests</directory> - </testsuite> - </testsuites> - <filter> - <whitelist addUncoveredFilesFromWhitelist="true"> - <directory suffix=".php">src</directory> - </whitelist> - </filter> -</phpunit> diff --git a/vendor/data-values/time/src/DataValues/TimeValue.php b/vendor/data-values/time/src/DataValues/TimeValue.php index f5587d2..eea2dcd 100644 --- a/vendor/data-values/time/src/DataValues/TimeValue.php +++ b/vendor/data-values/time/src/DataValues/TimeValue.php @@ -176,8 +176,6 @@ private $calendarModel; /** - * @since 0.1 - * * @param string $timestamp Timestamp in a format resembling ISO 8601. * @param int $timezone Time zone offset from UTC in minutes. * @param int $before Number of units given by the precision. @@ -246,14 +244,20 @@ throw new IllegalValueException( 'Month out of allowed bounds' ); } elseif ( $day > 31 ) { throw new IllegalValueException( 'Day out of allowed bounds' ); - } elseif ( $day > 0 && $month < 1 ) { - throw new IllegalValueException( 'Can not have a day with no month' ); } elseif ( $hour > 23 ) { throw new IllegalValueException( 'Hour out of allowed bounds' ); } elseif ( $minute > 59 ) { throw new IllegalValueException( 'Minute out of allowed bounds' ); } elseif ( $second > 61 ) { throw new IllegalValueException( 'Second out of allowed bounds' ); + } + + if ( $month < 1 && $day > 0 ) { + throw new IllegalValueException( 'Can not have a day with no month' ); + } + + if ( $day < 1 && ( $hour > 0 || $minute > 0 || $second > 0 ) ) { + throw new IllegalValueException( 'Can not have hour, minute or second with no day' ); } // Warning, never cast the year to integer to not run into 32-bit integer overflows! @@ -266,8 +270,6 @@ /** * @see $timestamp * - * @since 0.1 - * * @return string */ public function getTime() { @@ -276,8 +278,6 @@ /** * @see $calendarModel - * - * @since 0.1 * * @return string URI */ @@ -288,8 +288,6 @@ /** * @see $before * - * @since 0.1 - * * @return int Amount */ public function getBefore() { @@ -298,8 +296,6 @@ /** * @see $after - * - * @since 0.1 * * @return int Amount */ @@ -310,8 +306,6 @@ /** * @see $precision * - * @since 0.1 - * * @return int one of the self::PRECISION_... constants */ public function getPrecision() { @@ -320,8 +314,6 @@ /** * @see $timezone - * - * @since 0.1 * * @return int Minutes */ @@ -332,8 +324,6 @@ /** * @see DataValue::getType * - * @since 0.1 - * * @return string */ public static function getType() { @@ -342,8 +332,6 @@ /** * @see DataValue::getSortKey - * - * @since 0.1 * * @return string */ @@ -354,9 +342,7 @@ /** * @see DataValue::getValue * - * @since 0.1 - * - * @return TimeValue + * @return self */ public function getValue() { return $this; @@ -364,8 +350,6 @@ /** * @see Serializable::serialize - * - * @since 0.1 * * @return string */ @@ -375,8 +359,6 @@ /** * @see Serializable::unserialize - * - * @since 0.1 * * @param string $value * @@ -389,8 +371,6 @@ /** * @see DataValue::getArrayValue - * - * @since 0.1 * * @return array */ @@ -406,18 +386,26 @@ } /** - * Constructs a new instance of the DataValue from the provided data. - * This can round-trip with @see getArrayValue + * Constructs a new instance from the provided data. Required for @see DataValueDeserializer. + * This is expected to round-trip with @see getArrayValue. * - * @since 0.1 + * @deprecated since 0.8.6. Static DataValue::newFromArray constructors like this are + * underspecified (not in the DataValue interface), and misleadingly named (should be named + * newFromArrayValue). Instead, use DataValue builder callbacks in @see DataValueDeserializer. * - * @param mixed $data + * @param mixed $data Warning! Even if this is expected to be a value as returned by + * @see getArrayValue, callers of this specific newFromArray implementation can not guarantee + * this. This is not even guaranteed to be an array! * - * @return TimeValue - * @throws IllegalValueException + * @throws IllegalValueException if $data is not in the expected format. Subclasses of + * InvalidArgumentException are expected and properly handled by @see DataValueDeserializer. + * @return self */ public static function newFromArray( $data ) { - self::requireArrayFields( $data, array( 'time', 'timezone', 'before', 'after', 'precision', 'calendarmodel' ) ); + self::requireArrayFields( + $data, + array( 'time', 'timezone', 'before', 'after', 'precision', 'calendarmodel' ) + ); return new static( $data['time'], diff --git a/vendor/data-values/time/src/ValueParsers/IsoTimestampParser.php b/vendor/data-values/time/src/ValueParsers/IsoTimestampParser.php index e578a03..b5ed9d7 100644 --- a/vendor/data-values/time/src/ValueParsers/IsoTimestampParser.php +++ b/vendor/data-values/time/src/ValueParsers/IsoTimestampParser.php @@ -108,13 +108,13 @@ * 5 => minute, 6 => second and 7 => calendar model. */ private function splitTimeString( $value ) { - $pattern = '@^\s*' //leading spaces - . "([-+\xE2\x88\x92]?)\\s*" //sign - . '(\d{1,16})-(\d{2})-(\d{2})' //year, month and day - . '(?:T(\d{2}):?(\d{2})(?::?(\d{2}))?)?' //hour, minute and second - . 'Z?' //time zone - . '\s*\(?\s*' . CalendarModelParser::MODEL_PATTERN . '\s*\)?' //calendar model - . '\s*$@iu'; //trailing spaces + $pattern = '@^\s*' // leading spaces + . "([-+\xE2\x88\x92]?)\\s*" // sign + . '(\d{1,16})-(\d{2})-(\d{2})' // year-month-day + . '(?:T(\d{2}):?(\d{2})(?::?(\d{2}))?)?' // hour:minute:second + . 'Z?' // time zone + . '\s*\(?\s*' . CalendarModelParser::MODEL_PATTERN . '\s*\)?' // calendar model + . '\s*$@iu'; // trailing spaces if ( !preg_match( $pattern, $value, $matches ) ) { throw new ParseException( 'Malformed time' ); @@ -128,10 +128,10 @@ && $hour === '' ) { throw new ParseException( 'Not enough information to decide if the format is YMD' ); - } elseif ( $month > 12 ) { + } + + if ( $month > 12 ) { throw new ParseException( 'Month out of range' ); - } elseif ( $day > 0 && $month < 1 ) { - throw new ParseException( 'Can not have a day with no month' ); } elseif ( $day > 31 ) { throw new ParseException( 'Day out of range' ); } elseif ( $hour > 23 ) { @@ -142,6 +142,14 @@ throw new ParseException( 'Second out of range' ); } + if ( $month < 1 && $day > 0 ) { + throw new ParseException( 'Can not have a day with no month' ); + } + + if ( $day < 1 && ( $hour > 0 || $minute > 0 || $second > 0 ) ) { + throw new ParseException( 'Can not have hour, minute or second with no day' ); + } + $sign = str_replace( "\xE2\x88\x92", '-', $sign ); return array( $sign, $year, $month, $day, $hour, $minute, $second, $calendarModel ); diff --git a/vendor/data-values/time/src/ValueParsers/MonolingualMonthNameProvider.php b/vendor/data-values/time/src/ValueParsers/MonolingualMonthNameProvider.php index ced4284..a9e3866 100644 --- a/vendor/data-values/time/src/ValueParsers/MonolingualMonthNameProvider.php +++ b/vendor/data-values/time/src/ValueParsers/MonolingualMonthNameProvider.php @@ -20,7 +20,7 @@ /** * @param string[] $monthNames Array mapping month numbers (1 to 12) to localized month names. */ - function __construct( array $monthNames ) { + public function __construct( array $monthNames ) { $this->monthNames = $monthNames; } diff --git a/vendor/data-values/time/src/ValueParsers/MonthNameUnlocalizer.php b/vendor/data-values/time/src/ValueParsers/MonthNameUnlocalizer.php index 0fcf264..061d9eb 100644 --- a/vendor/data-values/time/src/ValueParsers/MonthNameUnlocalizer.php +++ b/vendor/data-values/time/src/ValueParsers/MonthNameUnlocalizer.php @@ -43,6 +43,10 @@ */ public function unlocalize( $date ) { foreach ( $this->replacements as $search => $replace ) { + if ( !is_string( $search ) ) { + continue; + } + $unlocalized = str_replace( $search, $replace, $date, $count ); // Nothing happened, try the next. diff --git a/vendor/data-values/time/src/ValueParsers/PhpDateTimeParser.php b/vendor/data-values/time/src/ValueParsers/PhpDateTimeParser.php index 3d03623..8ca0448 100644 --- a/vendor/data-values/time/src/ValueParsers/PhpDateTimeParser.php +++ b/vendor/data-values/time/src/ValueParsers/PhpDateTimeParser.php @@ -95,9 +95,9 @@ throw new ParseException( $value . ' is not a valid date.' ); } - // Input was three numbers? Where the heck does a time come from? + // Input was one, two, or three numbers? Where the heck does a time come from? if ( $dateTime->format( 'H:i:s' ) !== '00:00:00' - && preg_match( '/^\D*\d+\D+\d+\D+\d+\D*$/', $value ) + && preg_match( '/^\D*\d+(?:\D+\d+){0,2}\D*$/', $value ) ) { throw new ParseException( $value . ' is not a valid date.' ); } @@ -108,7 +108,7 @@ $timestamp = $sign . $dateTime->format( 'Y-m-d\TH:i:s\Z' ); } - // Pass the reformatted string into a base parser that parses this +/-Y-m-d\TH:i:s\Z format with a precision + // Use a common base parser for precision detection and option handling. return $this->isoTimestampParser->parse( $timestamp ); } catch ( Exception $exception ) { throw new ParseException( $exception->getMessage(), $rawValue, self::FORMAT_NAME ); diff --git a/vendor/data-values/time/src/ValueParsers/YearMonthTimeParser.php b/vendor/data-values/time/src/ValueParsers/YearMonthTimeParser.php index e7c64ba..bfe63fd 100644 --- a/vendor/data-values/time/src/ValueParsers/YearMonthTimeParser.php +++ b/vendor/data-values/time/src/ValueParsers/YearMonthTimeParser.php @@ -58,7 +58,8 @@ * @return TimeValue */ protected function stringParse( $value ) { - //Matches Year and month separated by a separator, \p{L} matches letters outside the ASCII range + // Matches year and month separated by a separator. + // \p{L} matches letters outside the ASCII range. if ( !preg_match( '/^(-?[\d\p{L}]+)\s*?[\/\-\s.,]\s*(-?[\d\p{L}]+)$/', trim( $value ), $matches ) ) { throw new ParseException( 'Failed to parse year and month', $value, self::FORMAT_NAME ); } diff --git a/vendor/data-values/time/src/ValueParsers/YearTimeParser.php b/vendor/data-values/time/src/ValueParsers/YearTimeParser.php index b7444b8..da74542 100644 --- a/vendor/data-values/time/src/ValueParsers/YearTimeParser.php +++ b/vendor/data-values/time/src/ValueParsers/YearTimeParser.php @@ -69,6 +69,7 @@ */ protected function stringParse( $value ) { list( $sign, $year ) = $this->eraParser->parse( $value ); + $year = trim( $year ); // Negative dates usually don't have a month, assume non-digits are thousands separators if ( $sign === '-' ) { diff --git a/vendor/data-values/time/tests/DataValues/TimeValueCalculatorTest.php b/vendor/data-values/time/tests/DataValues/TimeValueCalculatorTest.php deleted file mode 100644 index 0bbb256..0000000 --- a/vendor/data-values/time/tests/DataValues/TimeValueCalculatorTest.php +++ /dev/null @@ -1,212 +0,0 @@ -<?php - -namespace DataValues\Tests; - -use DataValues\TimeValue; -use DataValues\TimeValueCalculator; - -/** - * @covers DataValues\TimeValueCalculator - * - * @group DataValue - * @group DataValueExtensions - * - * @license GPL-2.0+ - * @author Thiemo Mättig - */ -class TimeValueCalculatorTest extends \PHPUnit_Framework_TestCase { - - /** - * @var TimeValueCalculator - */ - private $calculator; - - protected function setUp() { - $this->calculator = new TimeValueCalculator(); - } - - /** - * @param string $time an ISO 8601 date and time - * @param int $timezone offset from UTC in minutes - * - * @return TimeValue - */ - private function getTimeValueMock( $time, $timezone = 0 ) { - $timeValue = $this->getMockBuilder( 'DataValues\TimeValue' ) - ->disableOriginalConstructor() - ->getMock(); - - $timeValue->expects( $this->any() ) - ->method( 'getTime' ) - ->will( $this->returnValue( $time ) ); - $timeValue->expects( $this->any() ) - ->method( 'getTimezone' ) - ->will( $this->returnValue( $timezone ) ); - $timeValue->expects( $this->any() ) - ->method( 'getPrecision' ) - ->will( $this->returnValue( TimeValue::PRECISION_DAY ) ); - $timeValue->expects( $this->any() ) - ->method( 'getCalendarModel' ) - ->will( $this->returnValue( 'Stardate' ) ); - - return $timeValue; - } - - public function timestampProvider() { - return array( - // Make sure it's identical to the PHP/Unix time stamps in current years - array( '+2004-02-29T00:00:00Z', strtotime( '2004-02-29T00:00:00+00:00' ) ), - array( '+2038-00-00T00:00:00Z', strtotime( '2038-01-01T00:00:00+00:00' ) ), - - // Time zones - array( '+2000-01-01T12:59:59', strtotime( '2000-01-01T12:59:59-02:00' ), -120 ), - array( '+2000-01-01T12:59:59', strtotime( '2000-01-01T12:59:59+04:45' ), 285 ), - - array( '+0401-00-00T00:00:00Z', -49512816000 ), - array( '+1902-00-00T00:00:00Z', -2145916800 ), - array( '+1939-00-00T00:00:00Z', -978307200 ), - array( '+1969-12-31T23:59:00Z', -60 ), - array( '+1969-12-31T23:59:59Z', -1 ), - array( '+1970-01-01T00:00:00Z', 0 ), - array( '+1970-01-01T00:00:01Z', 1 ), - array( '+1970-01-01T00:01:00Z', 60 ), - array( '+1972-02-29T00:00:00Z', 68169600 ), - array( '+1996-02-29T00:00:00Z', 825552000 ), - array( '+1999-12-31T23:59:59Z', 946684799 ), - array( '+2000-01-01T00:00:00Z', 946684800 ), - array( '+2000-02-01T00:00:00Z', 949363200 ), - array( '+2000-02-29T00:00:00Z', 951782400 ), - array( '+2001-00-00T00:00:00Z', 978307200 ), - array( '+2001-01-01T00:00:00Z', 978307200 ), - array( '+2014-04-30T12:35:55Z', 1398861355 ), - array( '+2401-00-00T00:00:00Z', 13601088000 ), - - // Make sure there is only 1 second between these two - array( '-0001-12-31T23:59:59Z', -62135596801 ), - array( '+0001-00-00T00:00:00Z', -62135596800 ), - - // No special calculation for leap seconds, just make sure they pass - array( '+1970-10-11T12:13:61Z', 24495241 ), - array( '+1970-10-11T12:14:01Z', 24495241 ), - - // Year 0 does not exist, but we do not complain, assume -1 - array( '-0000-12-31T23:59:59Z', -62135596801 ), - array( '+0000-00-00T00:00:00Z', floor( ( -1 - 1969 ) * 365.2425 ) * 86400 ), - - // Since there is no year 0, negative leap years are -1, -5 and so on - array( '-8001-00-00T00:00:00Z', floor( ( -8001 - 1969 ) * 365.2425 ) * 86400 ), - array( '-0005-00-00T00:00:00Z', floor( ( -5 - 1969 ) * 365.2425 ) * 86400 ), - array( '+0004-00-00T00:00:00Z', floor( ( 4 - 1970 ) * 365.2425 ) * 86400 ), - array( '+8000-00-00T00:00:00Z', floor( ( 8000 - 1970 ) * 365.2425 ) * 86400 ), - - // PHP_INT_MIN is -2147483648 - array( '-2147484001-00-00T00:00:00Z', floor( ( -2147484001 - 1969 ) * 365.2425 ) * 86400 ), - // PHP_INT_MAX is +2147483647 - array( '+2147484000-00-00T00:00:00Z', floor( ( 2147484000 - 1970 ) * 365.2425 ) * 86400 ), - ); - } - - /** - * @dataProvider timestampProvider - */ - public function testGetTimestamp( $time, $expectedTimestamp = 0.0, $timezone = 0 ) { - $timeValue = $this->getTimeValueMock( $time, $timezone ); - $timestamp = $this->calculator->getTimestamp( $timeValue ); - - $this->assertEquals( $expectedTimestamp, $timestamp ); - } - - public function yearProvider() { - return array( - // Every 4 years - array( 1895, 459 ), - array( 1896, 460, true ), - array( 1897, 460 ), - - // Not every 100 years but every 400 years - array( 1900, 460 ), - array( 2000, 485, true ), - array( 2100, 509 ), - - // Extremes - array( 1, 0 ), - array( 9999, 2424 ), - array( 2147483647, 520764784 ), - - // There is no year zero, assume -1 - array( -1, 0, true ), - array( 0, 0, true ), - - // Off by 1 for negative years because zero is skipped - array( -6, -2 ), - array( -5, -1, true ), - array( -4, -1 ), - array( -3, -1 ), - array( -2, -1 ), - array( -1, 0, true ), - array( 1, 0 ), - array( 2, 0 ), - array( 3, 0 ), - array( 4, 1, true ), - array( 5, 1 ), - - // Because we can - array( -6.9, -2 ), - array( -6.1, -2 ), - array( -5.501, -1, true ), - array( -5.499, -1, true ), - array( -4.6, -1 ), - array( -4.4, -1 ), - array( 1995.01, 483 ), - array( 1995.09, 483 ), - array( 1996.001, 484, true ), - array( 1996.009, 484, true ), - array( 1997.1, 484 ), - array( 1997.9, 484 ), - ); - } - - /** - * @dataProvider yearProvider - */ - public function testIsLeapYear( $year, $numberOfLeapYears, $expected = false ) { - $isLeapYear = $this->calculator->isLeapYear( $year ); - - $this->assertEquals( $expected, $isLeapYear ); - } - - /** - * @dataProvider yearProvider - */ - public function testGetNumberOfLeapYears( $year, $expected, $isLeapYear = false ) { - $numberOfLeapYears = $this->calculator->getNumberOfLeapYears( $year ); - - $this->assertEquals( $expected, $numberOfLeapYears ); - } - - public function precisionProvider() { - $secondsPerDay = 60 * 60 * 24; - $daysPerGregorianYear = 365 + 1 / 4 - 1 / 100 + 1 / 400; - - return array( - array( TimeValue::PRECISION_SECOND, 1 ), - array( TimeValue::PRECISION_MINUTE, 60 ), - array( TimeValue::PRECISION_HOUR, 60 * 60 ), - array( TimeValue::PRECISION_DAY, $secondsPerDay ), - array( TimeValue::PRECISION_MONTH, $secondsPerDay * $daysPerGregorianYear / 12 ), - array( TimeValue::PRECISION_YEAR, $secondsPerDay * $daysPerGregorianYear ), - array( TimeValue::PRECISION_YEAR10, $secondsPerDay * $daysPerGregorianYear * 1e1 ), - array( TimeValue::PRECISION_YEAR1G, $secondsPerDay * $daysPerGregorianYear * 1e9 ), - ); - } - - /** - * @dataProvider precisionProvider - */ - public function testGetSecondsForPrecision( $precision, $expected ) { - $seconds = $this->calculator->getSecondsForPrecision( $precision ); - - $this->assertEquals( $expected, $seconds ); - } - -} diff --git a/vendor/data-values/time/tests/DataValues/TimeValueTest.php b/vendor/data-values/time/tests/DataValues/TimeValueTest.php deleted file mode 100644 index 733ce3b..0000000 --- a/vendor/data-values/time/tests/DataValues/TimeValueTest.php +++ /dev/null @@ -1,286 +0,0 @@ -<?php - -namespace DataValues\Tests; - -use DataValues\TimeValue; - -/** - * @covers DataValues\TimeValue - * - * @group DataValue - * @group DataValueExtensions - * - * @license GPL-2.0+ - * @author Jeroen De Dauw < jeroended...@gmail.com > - * @author Thiemo Mättig - */ -class TimeValueTest extends DataValueTest { - - /** - * @see DataValueTest::getClass - * - * @return string - */ - public function getClass() { - return 'DataValues\TimeValue'; - } - - public function validConstructorArgumentsProvider() { - return array( - '1 January' => array( - '+2013-01-01T00:00:00Z', - 0, 0, 0, - TimeValue::PRECISION_SECOND, - 'http://nyan.cat/original.php' - ), - 'Maximum timezone' => array( - '+2013-01-01T00:00:00Z', - 7200, 9001, 9001, - TimeValue::PRECISION_YEAR1G, - 'http://nyan.cat/original.php' - ), - 'Minimum timezone' => array( - '+2013-01-01T00:00:00Z', - -7200, 0, 42, - TimeValue::PRECISION_YEAR, - 'http://nyan.cat/original.php' - ), - 'Negative year' => array( - '-0005-01-01T00:00:00Z', - 0, 0, 0, - TimeValue::PRECISION_SECOND, - 'http://nyan.cat/original.php' - ), - 'No day' => array( - '+2015-01-00T00:00:00Z', - 0, 0, 0, - TimeValue::PRECISION_YEAR, - 'http://nyan.cat/original.php' - ), - 'No day and month' => array( - '+2015-00-00T00:00:00Z', - 0, 0, 0, - TimeValue::PRECISION_YEAR, - 'http://nyan.cat/original.php' - ), - 'Zero' => array( - '+0000-00-00T00:00:00Z', - 0, 0, 0, - TimeValue::PRECISION_SECOND, - 'http://nyan.cat/original.php' - ), - 'Minimum timestamp' => array( - '-9999999999999999-12-31T23:59:61Z', - 0, 0, 0, - TimeValue::PRECISION_SECOND, - 'http://nyan.cat/original.php' - ), - 'Maximum timestamp' => array( - '+9999999999999999-12-31T23:59:61Z', - 0, 0, 0, - TimeValue::PRECISION_SECOND, - 'http://nyan.cat/original.php' - ), - 'Leap year' => array( - '+2000-02-29T00:00:00Z', - 0, 0, 0, - TimeValue::PRECISION_DAY, - 'http://nyan.cat/original.php' - ), - 'Non-leap year 29 February' => array( - '+2015-02-29T00:00:00Z', - 0, 0, 0, - TimeValue::PRECISION_DAY, - 'http://nyan.cat/original.php' - ), - '31 November' => array( - '+2015-11-31T00:00:00Z', - 0, 0, 0, - TimeValue::PRECISION_DAY, - 'http://nyan.cat/original.php' - ), - ); - } - - public function invalidConstructorArgumentsProvider() { - return array( - 'String timezone' => array( - '+00000002013-01-01T00:00:00Z', - '0', 0, 0, - TimeValue::PRECISION_SECOND, - 'http://nyan.cat/original.php' - ), - 'Float timezone' => array( - '+00000002013-01-01T00:00:00Z', - 4.2, 0, 0, - TimeValue::PRECISION_SECOND, - 'http://nyan.cat/original.php' - ), - 'Timezone out of range' => array( - '+00000002013-01-01T00:00:00Z', - -20 * 3600, 0, 0, - TimeValue::PRECISION_SECOND, - 'http://nyan.cat/original.php' - ), - 'Precision out of range' => array( - '+00000002013-01-01T00:00:00Z', - 0, 0, 0, - 15, - 'http://nyan.cat/original.php' - ), - 'Integer timestamp' => array( - 42, - 0, 0, 0, - TimeValue::PRECISION_SECOND, - 'http://nyan.cat/original.php' - ), - 'Float before' => array( - '+00000002013-01-01T00:00:00Z', - 0, 4.2, 0, - TimeValue::PRECISION_SECOND, - 'http://nyan.cat/original.php' - ), - 'Negative after' => array( - '+00000002013-01-01T00:00:00Z', - 0, 0, -1, - TimeValue::PRECISION_SECOND, - 'http://nyan.cat/original.php' - ), - 'Non-ISO timestamp' => array( - 'bla', - 0, 0, 0, - TimeValue::PRECISION_SECOND, - 'http://nyan.cat/original.php' - ), - 'Invalid separators' => array( - '+00000002013/01/01 00:00:00', - 0, 0, 0, - TimeValue::PRECISION_SECOND, - 'http://nyan.cat/original.php' - ), - 'No month' => array( - '+2015-00-01T00:00:00Z', - 0, 0, 0, - TimeValue::PRECISION_DAY, - 'http://nyan.cat/original.php' - ), - 'Month out of range' => array( - '+00000002013-13-01T00:00:00Z', - 0, 0, 0, - TimeValue::PRECISION_SECOND, - 'http://nyan.cat/original.php' - ), - 'Day out of range' => array( - '+00000002013-01-32T00:00:00Z', - 0, 0, 0, - TimeValue::PRECISION_SECOND, - 'http://nyan.cat/original.php' - ), - 'Hour out of range' => array( - '+00000002013-01-01T24:00:00Z', - 0, 0, 0, - TimeValue::PRECISION_SECOND, - 'http://nyan.cat/original.php' - ), - 'Minute out of range' => array( - '+00000002013-01-01T00:60:00Z', - 0, 0, 0, - TimeValue::PRECISION_SECOND, - 'http://nyan.cat/original.php' - ), - 'Second out of range' => array( - '+00000002013-01-01T00:00:62Z', - 0, 0, 0, - TimeValue::PRECISION_SECOND, - 'http://nyan.cat/original.php' - ), - 'Invalid timezone' => array( - '+00000002013-01-01T00:00:00+60', - 0, 0, 0, - TimeValue::PRECISION_SECOND, - 'http://nyan.cat/original.php' - ), - 'Year to long' => array( - '+00000000000000001-01-01T00:00:00Z', - 0, 0, 0, - TimeValue::PRECISION_DAY, - 'http://nyan.cat/original.php' - ), - ); - } - - /** - * @dataProvider instanceProvider - */ - public function testGetTime( TimeValue $time, array $arguments ) { - $this->assertEquals( $arguments[0], $time->getTime() ); - } - - /** - * @dataProvider instanceProvider - */ - public function testGetTimezone( TimeValue $time, array $arguments ) { - $this->assertEquals( $arguments[1], $time->getTimezone() ); - } - - /** - * @dataProvider instanceProvider - */ - public function testGetBefore( TimeValue $time, array $arguments ) { - $this->assertEquals( $arguments[2], $time->getBefore() ); - } - - /** - * @dataProvider instanceProvider - */ - public function testGetAfter( TimeValue $time, array $arguments ) { - $this->assertEquals( $arguments[3], $time->getAfter() ); - } - - /** - * @dataProvider instanceProvider - */ - public function testGetPrecision( TimeValue $time, array $arguments ) { - $this->assertEquals( $arguments[4], $time->getPrecision() ); - } - - /** - * @dataProvider instanceProvider - */ - public function testGetCalendarModel( TimeValue $time, array $arguments ) { - $this->assertEquals( $arguments[5], $time->getCalendarModel() ); - } - - /** - * @dataProvider instanceProvider - */ - public function testGetValue( TimeValue $time, array $arguments ) { - $this->assertTrue( $time->equals( $time->getValue() ) ); - } - - /** - * @dataProvider unpaddedYearsProvider - */ - public function testGivenUnpaddedYear_yearIsPadded( $year, $expected ) { - $timeValue = new TimeValue( - $year . '-01-01T00:00:00Z', - 0, 0, 0, - TimeValue::PRECISION_DAY, - 'Stardate' - ); - $this->assertSame( $expected . '-01-01T00:00:00Z', $timeValue->getTime() ); - } - - public function unpaddedYearsProvider() { - return array( - array( '+1', '+0001' ), - array( '-10', '-0010' ), - array( '+2015', '+2015' ), - array( '+02015', '+2015' ), - array( '+00000010000', '+10000' ), - array( '+0000000000000001', '+0001' ), - array( '+9999999999999999', '+9999999999999999' ), - ); - } - -} diff --git a/vendor/data-values/time/tests/ValueFormatters/TimeFormatterTest.php b/vendor/data-values/time/tests/ValueFormatters/TimeFormatterTest.php deleted file mode 100644 index 4ee00e4..0000000 --- a/vendor/data-values/time/tests/ValueFormatters/TimeFormatterTest.php +++ /dev/null @@ -1,104 +0,0 @@ -<?php - -namespace ValueFormatters\Test; - -use DataValues\TimeValue; -use ValueFormatters\FormatterOptions; -use ValueFormatters\TimeFormatter; - -/** - * @covers ValueFormatters\TimeFormatter - * - * @group ValueFormatters - * @group DataValueExtensions - * - * @license GPL-2.0+ - * @author H. Snater < mediaw...@snater.com > - * @author Thiemo Mättig - */ -class TimeFormatterTest extends ValueFormatterTestBase { - - /** - * @deprecated since DataValues Interfaces 0.2, just use getInstance. - */ - protected function getFormatterClass() { - throw new \LogicException( 'Should not be called, use getInstance' ); - } - - /** - * @see ValueFormatterTestBase::getInstance - * - * @param FormatterOptions|null $options - * - * @return TimeFormatter - */ - protected function getInstance( FormatterOptions $options = null ) { - return new TimeFormatter( $options ); - } - - /** - * @see ValueFormatterTestBase::validProvider - */ - public function validProvider() { - $gregorian = 'http://www.wikidata.org/entity/Q1985727'; - $julian = 'http://www.wikidata.org/entity/Q1985786'; - - $baseOptions = new FormatterOptions(); - - $tests = array( - '+2013-07-16T00:00:00Z' => array( - '+2013-07-16T00:00:00Z', - ), - '+0000-01-01T00:00:00Z' => array( - '+0000-01-01T00:00:00Z', - ), - - // Different calendar models - '+0001-01-14T00:00:00Z' => array( - '+0001-01-14T00:00:00Z', - TimeValue::PRECISION_DAY, - $julian - ), - - // Different years - '+10000-01-01T00:00:00Z' => array( - '+10000-01-01T00:00:00Z', - ), - '-0001-01-01T00:00:00Z' => array( - '-0001-01-01T00:00:00Z', - ), - - // Different precisions - '+2013-07-17T00:00:00Z' => array( - '+2013-07-17T00:00:00Z', - TimeValue::PRECISION_MONTH, - ), - '+2013-07-18T00:00:00Z' => array( - '+2013-07-18T00:00:00Z', - TimeValue::PRECISION_YEAR, - ), - '+2013-07-19T00:00:00Z' => array( - '+2013-07-19T00:00:00Z', - TimeValue::PRECISION_YEAR10, - ), - ); - - $argLists = array(); - - foreach ( $tests as $expected => $args ) { - $timestamp = $args[0]; - $precision = isset( $args[1] ) ? $args[1] : TimeValue::PRECISION_DAY; - $calendarModel = isset( $args[2] ) ? $args[2] : $gregorian; - $options = isset( $args[3] ) ? $args[3] : $baseOptions; - - $argLists[] = array( - new TimeValue( $timestamp, 0, 0, 0, $precision, $calendarModel ), - $expected, - $options - ); - } - - return $argLists; - } - -} diff --git a/vendor/data-values/time/tests/ValueParsers/CalendarModelParserTest.php b/vendor/data-values/time/tests/ValueParsers/CalendarModelParserTest.php deleted file mode 100644 index a87ed2a..0000000 --- a/vendor/data-values/time/tests/ValueParsers/CalendarModelParserTest.php +++ /dev/null @@ -1,111 +0,0 @@ -<?php - -namespace ValueParsers\Test; - -use ValueParsers\CalendarModelParser; -use ValueParsers\ParserOptions; - -/** - * @covers ValueParsers\CalendarModelParser - * - * @group DataValue - * @group DataValueExtensions - * - * @author Addshore - * @author Thiemo Mättig - */ -class CalendarModelParserTest extends ValueParserTestBase { - - /** - * @deprecated since DataValues Common 0.3, just use getInstance. - */ - protected function getParserClass() { - throw new \LogicException( 'Should not be called, use getInstance' ); - } - - /** - * @see ValueParserTestBase::getInstance - * - * @return CalendarModelParser - */ - protected function getInstance() { - $options = new ParserOptions(); - - $options->setOption( CalendarModelParser::OPT_CALENDAR_MODEL_URIS, array( - 'Localized' => 'Unlocalized', - ) ); - - return new CalendarModelParser( $options ); - } - - /** - * @see ValueParserTestBase::requireDataValue - * - * @return bool - */ - protected function requireDataValue() { - return false; - } - - /** - * @see ValueParserTestBase::validInputProvider - */ - public function validInputProvider() { - $gregorian = 'http://www.wikidata.org/entity/Q1985727'; - $julian = 'http://www.wikidata.org/entity/Q1985786'; - - return array( - array( '', $gregorian ), - array( 'Gregorian', $gregorian ), - array( 'Julian', $julian ), - - // White space - array( ' ', $gregorian ), - array( ' Gregorian ', $gregorian ), - array( ' Julian ', $julian ), - - // Capitalization - array( 'GreGOrIAN', $gregorian ), - array( 'julian', $julian ), - array( 'JULIAN', $julian ), - - // See https://en.wikipedia.org/wiki/Gregorian_calendar - array( 'Western', $gregorian ), - array( 'Christian', $gregorian ), - - // URIs - array( 'http://www.wikidata.org/entity/Q1985727', $gregorian ), - array( 'http://www.wikidata.org/entity/Q1985786', $julian ), - - // Via OPT_CALENDAR_MODEL_URIS - array( 'Localized', 'Unlocalized' ), - ); - } - - /** - * @see ValueParserTestBase::invalidInputProvider - */ - public function invalidInputProvider() { - return array( - array( null ), - array( true ), - array( 1 ), - array( 'foobar' ), - - // Do not confuse Greece with Gregorian - array( 'gr' ), - array( 'gre' ), - - // Do not confuse July with Julian - array( 'Jul' ), - array( 'J' ), - - // Strict comparison for URIs and strings given via OPT_CALENDAR_MODEL_URIS - array( 'http://www.wikidata.org/entity/Q1985727 ' ), - array( 'Localized ' ), - array( 'localized' ), - array( 'LOCALIZED' ), - ); - } - -} diff --git a/vendor/data-values/time/tests/ValueParsers/EraParserTest.php b/vendor/data-values/time/tests/ValueParsers/EraParserTest.php deleted file mode 100644 index ea0f3a6..0000000 --- a/vendor/data-values/time/tests/ValueParsers/EraParserTest.php +++ /dev/null @@ -1,104 +0,0 @@ -<?php - -namespace ValueParsers\Test; - -use ValueParsers\EraParser; - -/** - * @covers ValueParsers\EraParser - * - * @group DataValue - * @group DataValueExtensions - * @group TimeParsers - * @group ValueParsers - * - * @license GPL-2.0+ - * @author Addshore - * @author Thiemo Mättig - */ -class EraParserTest extends StringValueParserTest { - - /** - * @deprecated since DataValues Common 0.3, just use getInstance. - */ - protected function getParserClass() { - throw new \LogicException( 'Should not be called, use getInstance' ); - } - - /** - * @see ValueParserTestBase::getInstance - * - * @return EraParser - */ - protected function getInstance() { - return new EraParser(); - } - - /** - * @see ValueParserTestBase::requireDataValue - * - * @return bool - */ - protected function requireDataValue() { - return false; - } - - /** - * @see ValueParserTestBase::validInputProvider - */ - public function validInputProvider() { - return array( - // Strings with no explicit era should be echoed - array( '1', array( '+', '1' ) ), - array( '1 000 000', array( '+', '1 000 000' ) ), - array( 'non-matching string', array( '+', 'non-matching string' ) ), - - // Strings with an era that should be split of - array( '+100', array( '+', '100' ) ), - array( '-100', array( '-', '100' ) ), - array( ' -100', array( '-', '100' ) ), - array( '100BC', array( '-', '100' ) ), - array( '100 BC', array( '-', '100' ) ), - array( '100 BCE', array( '-', '100' ) ), - array( '100 AD', array( '+', '100' ) ), - array( '100 A. D.', array( '+', '100' ) ), - array( ' 100 B. C. ', array( '-', '100' ) ), - array( ' 100 Common Era ', array( '+', '100' ) ), - array( '100 CE', array( '+', '100' ) ), - array( '100CE', array( '+', '100' ) ), - array( '+100', array( '+', '100' ) ), - array( '100 Common Era', array( '+', '100' ) ), - array( '100 Current Era', array( '+', '100' ) ), - array( '100 Christian Era', array( '+', '100' ) ), - array( '100Common Era', array( '+', '100' ) ), - array( '100 Before Common Era', array( '-', '100' ) ), - array( '100 Before Current Era', array( '-', '100' ) ), - array( '100 Before Christian Era', array( '-', '100' ) ), - array( '1 July 2013 Before Common Era', array( '-', '1 July 2013' ) ), - array( 'June 2013 Before Common Era', array( '-', 'June 2013' ) ), - array( '10-10-10 Before Common Era', array( '-', '10-10-10' ) ), - array( 'FooBefore Common Era', array( '-', 'Foo' ) ), - array( 'Foo Before Common Era', array( '-', 'Foo' ) ), - array( '-1 000 000', array( '-', '1 000 000' ) ), - array( '1 000 000 B.C.', array( '-', '1 000 000' ) ), - ); - } - - /** - * @see StringValueParserTest::invalidInputProvider - */ - public function invalidInputProvider() { - return array( - // Reject strings with two eras, no matter if conflicting or not - array( '-100BC' ), - array( '-100AD' ), - array( '-100CE' ), - array( '+100BC' ), - array( '+100AD' ), - array( '+100CE' ), - array( '+100 Before Common Era' ), - array( '+100 Common Era' ), - ); - } - -} diff --git a/vendor/data-values/time/tests/ValueParsers/IsoTimestampParserTest.php b/vendor/data-values/time/tests/ValueParsers/IsoTimestampParserTest.php deleted file mode 100644 index 1d9766b..0000000 --- a/vendor/data-values/time/tests/ValueParsers/IsoTimestampParserTest.php +++ /dev/null @@ -1,518 +0,0 @@ -<?php - -namespace ValueParsers\Test; - -use DataValues\TimeValue; -use ValueParsers\IsoTimestampParser; -use ValueParsers\ParserOptions; - -/** - * @covers ValueParsers\IsoTimestampParser - * - * @group DataValue - * @group DataValueExtensions - * - * @author Addshore - * @author Thiemo Mättig - */ -class IsoTimestampParserTest extends ValueParserTestBase { - - /** - * @deprecated since DataValues Common 0.3, just use getInstance. - */ - protected function getParserClass() { - throw new \LogicException( 'Should not be called, use getInstance' ); - } - - /** - * @see ValueParserTestBase::getInstance - * - * @return IsoTimestampParser - */ - protected function getInstance() { - return new IsoTimestampParser(); - } - - /** - * @see ValueParserTestBase::validInputProvider - */ - public function validInputProvider() { - $gregorian = 'http://www.wikidata.org/entity/Q1985727'; - $julian = 'http://www.wikidata.org/entity/Q1985786'; - - $julianOpts = new ParserOptions(); - $julianOpts->setOption( IsoTimestampParser::OPT_CALENDAR, $julian ); - - $gregorianOpts = new ParserOptions(); - $gregorianOpts->setOption( IsoTimestampParser::OPT_CALENDAR, $gregorian ); - - $prec10aOpts = new ParserOptions(); - $prec10aOpts->setOption( IsoTimestampParser::OPT_PRECISION, TimeValue::PRECISION_YEAR10 ); - - $precDayOpts = new ParserOptions(); - $precDayOpts->setOption( IsoTimestampParser::OPT_PRECISION, TimeValue::PRECISION_DAY ); - - $precSecondOpts = new ParserOptions(); - $precSecondOpts->setOption( IsoTimestampParser::OPT_PRECISION, TimeValue::PRECISION_SECOND ); - - $valid = array( - // Empty options tests - '+0000000000002013-07-16T00:00:00Z' => array( - '+2013-07-16T00:00:00Z', - TimeValue::PRECISION_DAY, - ), - '+0000000000002013-07-00T00:00:00Z' => array( - '+2013-07-00T00:00:00Z', - TimeValue::PRECISION_MONTH, - ), - '+0000000000002013-00-00T00:00:00Z' => array( - '+2013-00-00T00:00:00Z', - TimeValue::PRECISION_YEAR, - ), - '+0000000000000000-00-00T00:00:00Z' => array( - '+0000-00-00T00:00:00Z', - TimeValue::PRECISION_YEAR, - $julian - ), - '+0000000000002000-00-00T00:00:00Z' => array( - '+2000-00-00T00:00:00Z', - TimeValue::PRECISION_YEAR, - ), - '+0000000000008000-00-00T00:00:00Z' => array( - '+8000-00-00T00:00:00Z', - TimeValue::PRECISION_YEAR1K, - ), - '+0000000000020000-00-00T00:00:00Z' => array( - '+20000-00-00T00:00:00Z', - TimeValue::PRECISION_YEAR10K, - ), - '+0000000000200000-00-00T00:00:00Z' => array( - '+200000-00-00T00:00:00Z', - TimeValue::PRECISION_YEAR100K, - ), - '+0000000002000000-00-00T00:00:00Z' => array( - '+2000000-00-00T00:00:00Z', - TimeValue::PRECISION_YEAR1M, - ), - '+0000000020000000-00-00T00:00:00Z' => array( - '+20000000-00-00T00:00:00Z', - TimeValue::PRECISION_YEAR10M, - ), - '+0000000200000000-00-00T00:00:00Z' => array( - '+200000000-00-00T00:00:00Z', - TimeValue::PRECISION_YEAR100M, - ), - '+0000002000000000-00-00T00:00:00Z' => array( - '+2000000000-00-00T00:00:00Z', - TimeValue::PRECISION_YEAR1G, - ), - '+0000020000000000-00-00T00:00:00Z' => array( - '+20000000000-00-00T00:00:00Z', - TimeValue::PRECISION_YEAR1G, - ), - '+0000200000000000-00-00T00:00:00Z' => array( - '+200000000000-00-00T00:00:00Z', - TimeValue::PRECISION_YEAR1G, - ), - '+0002000000000000-00-00T00:00:00Z' => array( - '+2000000000000-00-00T00:00:00Z', - TimeValue::PRECISION_YEAR1G, - ), - '+0020000000000000-00-00T00:00:00Z' => array( - '+20000000000000-00-00T00:00:00Z', - TimeValue::PRECISION_YEAR1G, - ), - '+0200000000000000-00-00T00:00:00Z' => array( - '+200000000000000-00-00T00:00:00Z', - TimeValue::PRECISION_YEAR1G, - ), - '+2000000000000000-00-00T00:00:00Z' => array( - '+2000000000000000-00-00T00:00:00Z', - TimeValue::PRECISION_YEAR1G, - ), - '-2000000000000000-00-00T00:00:00Z' => array( - '-2000000000000000-00-00T00:00:00Z', - TimeValue::PRECISION_YEAR1G, - $julian - ), - '+0000000000002013-07-16T00:00:00Z (Gregorian)' => array( - '+2013-07-16T00:00:00Z', - TimeValue::PRECISION_DAY, - ), - '+0000000000000000-01-01T00:00:00Z (Gregorian)' => array( - '+0000-01-01T00:00:00Z', - TimeValue::PRECISION_DAY, - - ), - '+0000000000002001-01-14T00:00:00Z (Julian)' => array( - '+2001-01-14T00:00:00Z', - TimeValue::PRECISION_DAY, - $julian, - ), - '+0000000000010000-01-01T00:00:00Z (Gregorian)' => array( - '+10000-01-01T00:00:00Z', - TimeValue::PRECISION_DAY, - ), - '-0000000000000001-01-01T00:00:00Z (Gregorian)' => array( - '-0001-01-01T00:00:00Z', - TimeValue::PRECISION_DAY, - $gregorian - ), - '-00000000001-01-01T00:00:00Z (Gregorian)' => array( - '-0001-01-01T00:00:00Z', - TimeValue::PRECISION_DAY, - $gregorian, - $julianOpts // overridden by explicit calendar in input string - ), - '-00000000001-01-01T00:00:00Z (Julian)' => array( - '-0001-01-01T00:00:00Z', - TimeValue::PRECISION_DAY, - $julian, - $gregorianOpts // overridden by explicit calendar in input string - ), - '-000001-01-01T00:00:00Z (Gregorian)' => array( - '-0001-01-01T00:00:00Z', - TimeValue::PRECISION_DAY, - $gregorian - ), - '-1-01-01T00:00:00Z (Gregorian)' => array( - '-0001-01-01T00:00:00Z', - TimeValue::PRECISION_DAY, - $gregorian - ), - - // Tests with different options - '-1-01-02T00:00:00Z' => array( - '-0001-01-02T00:00:00Z', - TimeValue::PRECISION_DAY, - $gregorian, - $gregorianOpts, - ), - '+2001-01-03T00:00:00Z' => array( - '+2001-01-03T00:00:00Z', - TimeValue::PRECISION_DAY, - $julian, - $julianOpts, - ), - '-1-01-04T00:00:00Z' => array( - '-0001-01-04T00:00:00Z', - TimeValue::PRECISION_YEAR10, - $julian, - $prec10aOpts, - ), - '-1-01-05T00:00:00Z' => array( - '-0001-01-05T00:00:00Z', - TimeValue::PRECISION_DAY, - $julian, - ), - - '+1999-00-00T00:00:00Z' => array( - '+1999-00-00T00:00:00Z', - TimeValue::PRECISION_YEAR, - ), - '+2000-00-00T00:00:00Z' => array( - '+2000-00-00T00:00:00Z', - TimeValue::PRECISION_YEAR, - ), - '+2010-00-00T00:00:00Z' => array( - '+2010-00-00T00:00:00Z', - TimeValue::PRECISION_YEAR, - ), - - // Optional sign character - '2015-01-01T00:00:00Z' => array( - '+2015-01-01T00:00:00Z', - TimeValue::PRECISION_DAY, - ), - - // Optional time zone - '2015-01-01T00:00:00' => array( - '+2015-01-01T00:00:00Z', - TimeValue::PRECISION_DAY, - ), - - // Actual minus character from Unicode; roundtrip with TimeDetailsFormatter - "\xE2\x88\x922015-01-01T00:00:00" => array( - '-2015-01-01T00:00:00Z', - TimeValue::PRECISION_DAY, - $julian - ), - - // Optional colons - '2015-01-01T161718' => array( - '+0000000000002015-01-01T16:17:18Z', - TimeValue::PRECISION_SECOND, - ), - '2015-01-01T1617' => array( - '+0000000000002015-01-01T16:17:00Z', - TimeValue::PRECISION_MINUTE, - ), - - // Optional second - '2015-01-01T00:00' => array( - '+2015-01-01T00:00:00Z', - TimeValue::PRECISION_DAY, - ), - - // Optional hour and minute - '2015-01-01' => array( - '+2015-01-01T00:00:00Z', - TimeValue::PRECISION_DAY, - ), - '60-01-01' => array( - '+0060-01-01T00:00:00Z', - TimeValue::PRECISION_DAY, - $julian - ), - // 32 can not be confused with anything. Can't be day or month. Can't be minute or - // second because a time can not start with minute or second. - '32-01-01' => array( - '+0032-01-01T00:00:00Z', - TimeValue::PRECISION_DAY, - $julian - ), - - // Years <= 31 require either the time part or a year with more than 2 digits - '1-01-01T00:00' => array( - '+0001-01-01T00:00:00Z', - TimeValue::PRECISION_DAY, - $julian - ), - '001-01-01' => array( - '+0001-01-01T00:00:00Z', - TimeValue::PRECISION_DAY, - $julian - ), - // 00-00-00 to 24-00-00 can be confused with a time, but not if it is signed. - '-01-02-03' => array( - '-0001-02-03T00:00:00Z', - TimeValue::PRECISION_DAY, - $julian - ), - '+01-02-03' => array( - '+0001-02-03T00:00:00Z', - TimeValue::PRECISION_DAY, - $julian - ), - - // Day zero - '2015-01-00' => array( - '+2015-01-00T00:00:00Z', - TimeValue::PRECISION_MONTH, - ), - - // Month zero - '2015-00-00' => array( - '+2015-00-00T00:00:00Z', - TimeValue::PRECISION_YEAR, - ), - - // Leap seconds are a valid concept - '+2015-01-01T00:00:61Z' => array( - '+2015-01-01T00:00:61Z', - TimeValue::PRECISION_SECOND, - ), - - // Tests for correct precision when a bad precision is passed through the opts - // @see https://bugzilla.wikimedia.org/show_bug.cgi?id=62730 - '+0000000000000012-12-00T00:00:00Z' => array( - '+0012-12-00T00:00:00Z', - TimeValue::PRECISION_MONTH, - $julian, - $precDayOpts, - ), - '+2015-01-01T00:00:00Z' => array( - '+2015-01-01T00:00:00Z', - TimeValue::PRECISION_SECOND, - $gregorian, - $precSecondOpts, - ), - - // Test Julian/Gregorian switch in October 1582. - '1583-01-01' => array( - '+1583-01-01T00:00:00Z', - TimeValue::PRECISION_DAY, - $gregorian - ), - - // Test Julian/Gregorian switch in October 1582. - '1582-08-01' => array( - '+1582-08-01T00:00:00Z', - TimeValue::PRECISION_DAY, - $julian - ), - ); - - $argLists = array(); - - foreach ( $valid as $key => $value ) { - $timestamp = $value[0]; - $precision = isset( $value[1] ) ? $value[1] : TimeValue::PRECISION_DAY; - $calendarModel = isset( $value[2] ) ? $value[2] : $gregorian; - $options = isset( $value[3] ) ? $value[3] : null; - - $argLists[] = array( - // Because PHP magically turns numeric keys into ints/floats - (string)$key, - new TimeValue( $timestamp, 0, 0, 0, $precision, $calendarModel ), - new IsoTimestampParser( null, $options ) - ); - } - - return $argLists; - } - - /** - * @see ValueParserTestBase::invalidInputProvider - */ - public function invalidInputProvider() { - $argLists = array(); - - $invalid = array( - // Stuff that's not even a string - true, - false, - null, - array(), - 'foooooooooo', - '1 June 2014', - // Can be confused with a time (HMS), DMY or MDY - '00-00-00', - '12-01-01', - '24-00-00', - '31-01-01', - // Month and day must be two digits - '2015-12-1', - '2015-1-31', - // Time and seconds are optional, but hour without minutes is not allowed - '+2015-12-31T23', - '+2015-12-31T23Z', - // Elements out of allowed bounds - '+2015-00-01T00:00:00Z', - '+2015-13-01T00:00:00Z', - '+2015-01-32T00:00:00Z', - '+2015-01-01T24:00:00Z', - '+2015-01-01T00:60:00Z', - '+2015-01-01T00:00:62Z', - // This parser should not replace the year parser - '1234567890873', - 2134567890 - ); - - foreach ( $invalid as $value ) { - $argLists[] = array( $value ); - } - - return $argLists; - } - - /** - * @dataProvider optionsProvider - */ - public function testOptions( - $value, - array $options, - $timestamp, - $calendarModel, - $precision = TimeValue::PRECISION_DAY - ) { - $parser = new IsoTimestampParser( null, new ParserOptions( $options ) ); - $this->assertEquals( - new TimeValue( $timestamp, 0, 0, 0, $precision, $calendarModel ), - $parser->parse( $value ) - ); - } - - public function optionsProvider() { - $gregorian = 'http://www.wikidata.org/entity/Q1985727'; - $julian = 'http://www.wikidata.org/entity/Q1985786'; - - return array( - 'Auto-detected Gregorian' => array( - '1583-01-31', - array(), - '+1583-01-31T00:00:00Z', - $gregorian - ), - 'Option overrides auto-detected Gregorian' => array( - '1583-01-31', - array( IsoTimestampParser::OPT_CALENDAR => $julian ), - '+1583-01-31T00:00:00Z', - $julian - ), - 'Auto-detected Julian' => array( - '1582-01-31', - array(), - '+1582-01-31T00:00:00Z', - $julian - ), - 'Option overrides auto-detected Julian' => array( - '1582-01-31', - array( IsoTimestampParser::OPT_CALENDAR => $gregorian ), - '+1582-01-31T00:00:00Z', - $gregorian - ), - 'Option can decrease precision' => array( - '2016-01-31', - array( IsoTimestampParser::OPT_PRECISION => TimeValue::PRECISION_MONTH ), - '+2016-01-31T00:00:00Z', - $gregorian, - TimeValue::PRECISION_MONTH - ), - 'Option can set minimal precision' => array( - '2016-01-31', - array( IsoTimestampParser::OPT_PRECISION => TimeValue::PRECISION_YEAR1G ), - '+2016-01-31T00:00:00Z', - $gregorian, - TimeValue::PRECISION_YEAR1G - ), - 'Option can not increase year precision' => array( - '2016-00-00', - array( IsoTimestampParser::OPT_PRECISION => TimeValue::PRECISION_MONTH ), - '+2016-00-00T00:00:00Z', - $gregorian, - TimeValue::PRECISION_YEAR - ), - 'Option can not increase month precision' => array( - '2016-01-00', - array( IsoTimestampParser::OPT_PRECISION => TimeValue::PRECISION_DAY ), - '+2016-01-00T00:00:00Z', - $gregorian, - TimeValue::PRECISION_MONTH - ), - 'Option can increase day precision' => array( - '2016-01-31', - array( IsoTimestampParser::OPT_PRECISION => TimeValue::PRECISION_HOUR ), - '+2016-01-31T00:00:00Z', - $gregorian, - TimeValue::PRECISION_HOUR - ), - 'Precision option accepts strings' => array( - '2016-01-31', - array( IsoTimestampParser::OPT_PRECISION => '10' ), - '+2016-01-31T00:00:00Z', - $gregorian, - TimeValue::PRECISION_MONTH - ), - ); - } - - /** - * @dataProvider invalidOptionsProvider - */ - public function testInvalidOptions( array $options ) { - $parser = new IsoTimestampParser( null, new ParserOptions( $options ) ); - $this->setExpectedException( 'ValueParsers\ParseException' ); - $parser->parse( '2016-01-31' ); - } - - public function invalidOptionsProvider() { - return array( - array( array( IsoTimestampParser::OPT_PRECISION => -1 ) ), - array( array( IsoTimestampParser::OPT_PRECISION => 1.5 ) ), - array( array( IsoTimestampParser::OPT_PRECISION => 1000 ) ), - array( array( IsoTimestampParser::OPT_PRECISION => 'invalid' ) ), - ); - } - -} diff --git a/vendor/data-values/time/tests/ValueParsers/MonolingualMonthNameProviderTest.php b/vendor/data-values/time/tests/ValueParsers/MonolingualMonthNameProviderTest.php deleted file mode 100644 index 455c0ba..0000000 --- a/vendor/data-values/time/tests/ValueParsers/MonolingualMonthNameProviderTest.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php - -namespace ValueParsers\Test; - -use PHPUnit_Framework_TestCase; -use ValueParsers\MonolingualMonthNameProvider; - -/** - * @covers ValueParsers\MonolingualMonthNameProvider - * - * @group DataValue - * @group DataValueExtensions - * @group ValueParsers - * - * @license GPL-2.0+ - * @author Thiemo Mättig - */ -class MonolingualMonthNameProviderTest extends PHPUnit_Framework_TestCase { - - public function testGetLocalizedMonthNames() { - $instance = new MonolingualMonthNameProvider( array( 1 => 'January' ) ); - $this->assertSame( array( 1 => 'January' ), $instance->getLocalizedMonthNames( 'xx' ) ); - } - - public function testGetMonthNumbers() { - $instance = new MonolingualMonthNameProvider( array( 1 => 'January' ) ); - $this->assertSame( array( 'January' => 1 ), $instance->getMonthNumbers( 'xx' ) ); - } - -} diff --git a/vendor/data-values/time/tests/ValueParsers/MonthNameUnlocalizerTest.php b/vendor/data-values/time/tests/ValueParsers/MonthNameUnlocalizerTest.php deleted file mode 100644 index 95ace6e..0000000 --- a/vendor/data-values/time/tests/ValueParsers/MonthNameUnlocalizerTest.php +++ /dev/null @@ -1,80 +0,0 @@ -<?php - -namespace ValueParsers\Test; - -use PHPUnit_Framework_TestCase; -use ValueParsers\MonthNameUnlocalizer; - -/** - * @covers ValueParsers\MonthNameUnlocalizer - * - * @group DataValue - * @group DataValueExtensions - * @group ValueParsers - * - * @license GPL-2.0+ - * @author Addshore - * @author Thiemo Mättig - */ -class MonthNameUnlocalizerTest extends PHPUnit_Framework_TestCase { - - /** - * @dataProvider localizedDateProvider - */ - public function testUnlocalize( - $date, - $expected, - array $replacements - ) { - $unlocalizer = new MonthNameUnlocalizer( $replacements ); - - $this->assertEquals( $expected, $unlocalizer->unlocalize( $date ) ); - } - - public function localizedDateProvider() { - return array( - // No replacements given - array( '', '', array() ), - array( 'Jul', 'Jul', array() ), - - // Longer strings do have higher priority - array( 'Juli', 'July', array( - 'Jul' => 'bad', - 'Juli' => 'July', - ) ), - array( 'Juli', 'July', array( - 'Juli' => 'July', - 'Jul' => 'bad', - ) ), - - // Do not mess with strings that are clearly not a valid date. - array( 'July July', 'July July', array( - 'July' => 'bad', - ) ), - - // Do not mess with already unlocalized month names. - array( 'July', 'July', array( - 'Jul' => 'July', - ) ), - - // But shortening is ok even if a substring looks like it's already unlocalized. - array( 'July', 'Jul', array( - 'July' => 'Jul', - ) ), - - // Word boundaries currently do not prevent unlocalization on purpose. - array( '1Jul2015', '1July2015', array( - 'Jul' => 'July', - ) ), - array( '1stJulLastYear', '1stJulyLastYear', array( - 'Jul' => 'July', - ) ), - - // Capitalization is currently significant. This may need to depend on the languages. - array( 'jul', 'jul', array( - 'Jul' => 'bad', - ) ), - ); - } - -} diff --git a/vendor/data-values/time/tests/ValueParsers/PhpDateTimeParserTest.php b/vendor/data-values/time/tests/ValueParsers/PhpDateTimeParserTest.php deleted file mode 100644 index b0941d3..0000000 --- a/vendor/data-values/time/tests/ValueParsers/PhpDateTimeParserTest.php +++ /dev/null @@ -1,309 +0,0 @@ -<?php - -namespace ValueParsers\Test; - -use DataValues\TimeValue; -use ValueParsers\IsoTimestampParser; -use ValueParsers\MonthNameUnlocalizer; -use ValueParsers\ParserOptions; -use ValueParsers\PhpDateTimeParser; -use ValueParsers\ValueParser; - -/** - * @covers ValueParsers\PhpDateTimeParser - * - * @group DataValue - * @group DataValueExtensions - * @group TimeParsers - * @group ValueParsers - * - * @license GPL-2.0+ - * @author Addshore - * @author Thiemo Mättig - */ -class PhpDateTimeParserTest extends StringValueParserTest { - - /** - * @deprecated since DataValues Common 0.3, just use getInstance. - */ - protected function getParserClass() { - throw new \LogicException( 'Should not be called, use getInstance' ); - } - - /** - * @see ValueParserTestBase::getInstance - * - * @return PhpDateTimeParser - */ - protected function getInstance() { - $options = new ParserOptions(); - - return new PhpDateTimeParser( - new MonthNameUnlocalizer( array() ), - $this->getEraParser(), - new IsoTimestampParser( null, $options ) - ); - } - - /** - * @return ValueParser - */ - private function getEraParser() { - $mock = $this->getMock( 'ValueParsers\ValueParser' ); - - $mock->expects( $this->any() ) - ->method( 'parse' ) - ->with( $this->isType( 'string' ) ) - ->will( $this->returnCallback( - function( $value ) { - $sign = '+'; - // Tiny parser that supports a single negative sign only - if ( $value[0] === '-' ) { - $sign = '-'; - $value = substr( $value, 1 ); - } - return array( $sign, $value ) ; - } - ) ); - - return $mock; - } - - /** - * @see ValueParserTestBase::validInputProvider - */ - public function validInputProvider() { - $gregorian = 'http://www.wikidata.org/entity/Q1985727'; - $julian = 'http://www.wikidata.org/entity/Q1985786'; - $argList = array(); - - $valid = array( - // Normal/easy dates - '10/10/2010' => - array( '+0000000000002010-10-10T00:00:00Z' ), - '10.10.2010' => - array( '+0000000000002010-10-10T00:00:00Z' ), - ' 10. 10. 2010 ' => - array( '+0000000000002010-10-10T00:00:00Z' ), - '10,10,2010' => - array( '+0000000000002010-10-10T00:00:00Z' ), - '10 10 2010' => - array( '+0000000000002010-10-10T00:00:00Z' ), - '10/10/0010' => - array( '+0000000000000010-10-10T00:00:00Z', TimeValue::PRECISION_DAY, $julian ), - '1 July 2013' => - array( '+0000000000002013-07-01T00:00:00Z' ), - '1. July 2013' => - array( '+0000000000002013-07-01T00:00:00Z' ), - '1 July, 2013' => - array( '+0000000000002013-07-01T00:00:00Z' ), - '1 Jul. 2013' => - array( '+0000000000002013-07-01T00:00:00Z' ), - '1 Jul 2013' => - array( '+0000000000002013-07-01T00:00:00Z' ), - 'January 9 1920' => - array( '+0000000000001920-01-09T00:00:00Z' ), - 'Feb 11 1930' => - array( '+0000000000001930-02-11T00:00:00Z' ), - '1st July 2013' => - array( '+0000000000002013-07-01T00:00:00Z' ), - '2nd July 2013' => - array( '+0000000000002013-07-02T00:00:00Z' ), - '3rd July 2013' => - array( '+0000000000002013-07-03T00:00:00Z' ), - '1th July 2013' => - array( '+0000000000002013-07-01T00:00:00Z' ), - '2th July 2013' => - array( '+0000000000002013-07-02T00:00:00Z' ), - '3th July 2013' => - array( '+0000000000002013-07-03T00:00:00Z' ), - '4th July 2013' => - array( '+0000000000002013-07-04T00:00:00Z' ), - - // Year first dates - '2009-01-09' => - array( '+0000000000002009-01-09T00:00:00Z' ), - '55-01-09' => - array( '+0000000000000055-01-09T00:00:00Z', TimeValue::PRECISION_DAY, $julian ), - '555-01-09' => - array( '+0000000000000555-01-09T00:00:00Z', TimeValue::PRECISION_DAY, $julian ), - '33300-1-1' => - array( '+0000000000033300-01-01T00:00:00Z' ), - '3330002-1-1' => - array( '+0000000003330002-01-01T00:00:00Z' ), - - // Less than 4 digit years - '10/10/10' => - array( '+0000000000000010-10-10T00:00:00Z', TimeValue::PRECISION_DAY, $julian ), - '9 Jan 09' => - array( '+0000000000000009-01-09T00:00:00Z', TimeValue::PRECISION_DAY, $julian ), - '1/1/1' => - array( '+0000000000000001-01-01T00:00:00Z', TimeValue::PRECISION_DAY, $julian ), - '1-1-1' => - array( '+0000000000000001-01-01T00:00:00Z', TimeValue::PRECISION_DAY, $julian ), - '31-1-55' => - array( '+0000000000000055-01-31T00:00:00Z', TimeValue::PRECISION_DAY, $julian ), - '10-10-100' => - array( '+0000000000000100-10-10T00:00:00Z', TimeValue::PRECISION_DAY, $julian ), - '4th July 11' => - array( '+0000000000000011-07-04T00:00:00Z', TimeValue::PRECISION_DAY, $julian ), - '4th July 111' => - array( '+0000000000000111-07-04T00:00:00Z', TimeValue::PRECISION_DAY, $julian ), - '4th July 1' => - array( '+0000000000000001-07-04T00:00:00Z', TimeValue::PRECISION_DAY, $julian ), - '12.Jun.10x' => - array( '+0000000000000010-06-12T00:00:00Z', TimeValue::PRECISION_DAY, $julian ), - - // More than 4 digit years - '4th July 10000' => - array( '+0000000000010000-07-04T00:00:00Z' ), - '10/10/22000' => - array( '+0000000000022000-10-10T00:00:00Z' ), - '1-1-33300' => - array( '+0000000000033300-01-01T00:00:00Z' ), - '4th July 7214614279199781' => - array( '+7214614279199781-07-04T00:00:00Z' ), - '-10100-02-29' => - array( '-0000000000010100-03-01T00:00:00Z', TimeValue::PRECISION_DAY, $julian ), - - // Years with leading zeros - '009-08-07' => - array( '+0000000000000009-08-07T00:00:00Z', TimeValue::PRECISION_DAY, $julian ), - '000001-07-04' => - array( '+0000000000000001-07-04T00:00:00Z', TimeValue::PRECISION_DAY, $julian ), - '0000001-07-04' => - array( '+0000000000000001-07-04T00:00:00Z', TimeValue::PRECISION_DAY, $julian ), - '00000001-07-04' => - array( '+0000000000000001-07-04T00:00:00Z', TimeValue::PRECISION_DAY, $julian ), - '000000001-07-04' => - array( '+0000000000000001-07-04T00:00:00Z', TimeValue::PRECISION_DAY, $julian ), - '00000000000-07-04' => - array( '+0000000000000000-07-04T00:00:00Z', TimeValue::PRECISION_DAY, $julian ), - '4th July 00000002015' => - array( '+0000000000002015-07-04T00:00:00Z' ), - '00000002015-07-04' => - array( '+0000000000002015-07-04T00:00:00Z' ), - '4th July 00000092015' => - array( '+0000000000092015-07-04T00:00:00Z' ), - '00000092015-07-04' => - array( '+0000000000092015-07-04T00:00:00Z' ), - - // Hour, minute and second precision - '4 July 2015 23:59' => - array( '+0000000000002015-07-04T23:59:00Z', TimeValue::PRECISION_MINUTE ), - '4 July 100 23:59' => - array( '+0000000000000100-07-04T23:59:00Z', TimeValue::PRECISION_MINUTE, $julian ), - '4 July 015 23:59' => - array( '+0000000000000015-07-04T23:59:00Z', TimeValue::PRECISION_MINUTE, $julian ), - '4 July 15 23:59' => - array( '+0000000000000015-07-04T23:59:00Z', TimeValue::PRECISION_MINUTE, $julian ), - '4.7.015 23:59' => - array( '+0000000000000015-07-04T23:59:00Z', TimeValue::PRECISION_MINUTE, $julian ), - '4.7.15 23:59' => - array( '+0000000000000015-07-04T23:59:00Z', TimeValue::PRECISION_MINUTE, $julian ), - '4/7/015 23:59' => - array( '+0000000000000015-04-07T23:59:00Z', TimeValue::PRECISION_MINUTE, $julian ), - '4/7/15 23:59' => - array( '+0000000000000015-04-07T23:59:00Z', TimeValue::PRECISION_MINUTE, $julian ), - '4th July 2015 12:00' => - array( '+0000000000002015-07-04T12:00:00Z', TimeValue::PRECISION_HOUR ), - '2015-07-04 12:00' => - array( '+0000000000002015-07-04T12:00:00Z', TimeValue::PRECISION_HOUR ), - '2015-07-04 12:30' => - array( '+0000000000002015-07-04T12:30:00Z', TimeValue::PRECISION_MINUTE ), - '2015-07-04 12:30:29' => - array( '+0000000000002015-07-04T12:30:29Z', TimeValue::PRECISION_SECOND ), - '15.07.04 23:59' => - array( '+0000000000000004-07-15T23:59:00Z', TimeValue::PRECISION_MINUTE, $julian ), - '15.07.04 00:01' => - array( '+0000000000000004-07-15T00:01:00Z', TimeValue::PRECISION_MINUTE, $julian ), - '15-07-01 12:37:00' => - array( '+0000000000000001-07-15T12:37:00Z', TimeValue::PRECISION_MINUTE, $julian ), - '4th July 15 12:00' => - array( '+0000000000000015-07-04T12:00:00Z', TimeValue::PRECISION_HOUR, $julian ), - 'July 4th 15 12:00' => - array( '+0000000000000015-07-04T12:00:00Z', TimeValue::PRECISION_HOUR, $julian ), - - // Testing leap year stuff - '10000-02-29' => - array( '+0000000000010000-02-29T00:00:00Z' ), - '10100-02-29' => - array( '+0000000000010100-03-01T00:00:00Z' ), - '10400-02-29' => - array( '+0000000000010400-02-29T00:00:00Z' ), - - 'Jan1 1991' => - array( '+1991-01-01T00:00:00Z' ), - '1991-1-1' => - array( '+1991-01-01T00:00:00Z' ), - '1991/1/1' => - array( '+1991-01-01T00:00:00Z' ), - '1991 1 1' => - array( '+1991-01-01T00:00:00Z' ), - '1991.1.1' => - array( '+1991-01-01T00:00:00Z' ), - '1991.01.01' => - array( '+1991-01-01T00:00:00Z' ), - ); - - foreach ( $valid as $value => $args ) { - $timestamp = $args[0]; - $precision = isset( $args[1] ) ? $args[1] : TimeValue::PRECISION_DAY; - $calendarModel = isset( $args[2] ) ? $args[2] : $gregorian; - - $argList[] = array( - // Because PHP magically turns numeric keys into ints/floats - (string)$value, - new TimeValue( $timestamp, 0, 0, 0, $precision, $calendarModel ) - ); - } - - return $argList; - } - - /** - * @see StringValueParserTest::invalidInputProvider - */ - public function invalidInputProvider() { - $argLists = parent::invalidInputProvider(); - - $invalid = array( - 'June June June', - '111 111 111', - '101st July 2015', - '2015-07-101', - '10 .10 .2010', - '10...10...2010', - '00-00-00', - '99-00-00', - '111-00-00', - '2015-00-00', - '00000000099-00-00', - '00000002015-00-00', - '92015-00-00', - 'Jann 2014', - '1980x', - '1980s', - '1980', - '1980ss', - '1980er', - '1980UTC', - '1980America/New_York', - '1980 America/New_York', - '1980+3', - '1980+x', - 'x', - 'x x x', - 'zz', - 'America/New_York', - '1991 2', - ); - - foreach ( $invalid as $value ) { - $argLists[] = array( $value ); - } - - return $argLists; - } - -} diff --git a/vendor/data-values/time/tests/ValueParsers/YearMonthDayTimeParserTest.php b/vendor/data-values/time/tests/ValueParsers/YearMonthDayTimeParserTest.php deleted file mode 100644 index 8532c42..0000000 --- a/vendor/data-values/time/tests/ValueParsers/YearMonthDayTimeParserTest.php +++ /dev/null @@ -1,292 +0,0 @@ -<?php - -namespace ValueParsers\Test; - -use DataValues\TimeValue; -use ValueParsers\IsoTimestampParser; -use ValueParsers\ParserOptions; -use ValueParsers\YearMonthDayTimeParser; - -/** - * @covers ValueParsers\YearMonthDayTimeParser - * - * @group DataValue - * @group DataValueExtensions - * @group TimeParsers - * @group ValueParsers - * - * @license GPL-2.0+ - * @author Thiemo Mättig - */ -class YearMonthDayTimeParserTest extends StringValueParserTest { - - /** - * @deprecated since DataValues Common 0.3, just use getInstance. - */ - protected function getParserClass() { - throw new \LogicException( 'Should not be called, use getInstance' ); - } - - /** - * @see ValueParserTestBase::getInstance - * - * @return YearMonthDayTimeParser - */ - protected function getInstance() { - return new YearMonthDayTimeParser(); - } - - /** - * @see ValueParserTestBase::validInputProvider - */ - public function validInputProvider() { - $gregorian = 'http://www.wikidata.org/entity/Q1985727'; - $julian = 'http://www.wikidata.org/entity/Q1985786'; - - $valid = array( - // Whitespace - "2016-01-01\n" => array( '+2016-01-01T00:00:00Z' ), - ' 2016-01-01 ' => array( '+2016-01-01T00:00:00Z' ), - - // YMD, typically used in ISO 8601 - '2015-12-31' => array( '+2015-12-31T00:00:00Z' ), - '2015 12 31' => array( '+2015-12-31T00:00:00Z' ), - '2015 1 13' => array( '+2015-01-13T00:00:00Z' ), - - // DMY - '31.12.2015' => array( '+2015-12-31T00:00:00Z' ), - '31. 12. 2015' => array( '+2015-12-31T00:00:00Z' ), - '31/12/2015' => array( '+2015-12-31T00:00:00Z' ), - '31 12 2015' => array( '+2015-12-31T00:00:00Z' ), - '31th 12th 2015' => array( '+2015-12-31T00:00:00Z' ), - 'day 31, month 12, year 2015' => array( '+2015-12-31T00:00:00Z' ), - - // MDY, almost exclusively used in the United States - '12/31/2015' => array( '+2015-12-31T00:00:00Z' ), - '12-31-2015' => array( '+2015-12-31T00:00:00Z' ), - '12 31 2015' => array( '+2015-12-31T00:00:00Z' ), - - // YDM, exclusively used in Kazakhstan - // https://en.wikipedia.org/wiki/Calendar_date#Gregorian.2C_year-day-month_.28YDM.29 - '2015.31.12' => array( '+2015-12-31T00:00:00Z' ), - '2015 13 1' => array( '+2015-01-13T00:00:00Z' ), - - // Month and day are the same, does not matter if DMY or MDY - '01 1 2015' => array( '+2015-01-01T00:00:00Z' ), - '12 12 2015' => array( '+2015-12-12T00:00:00Z' ), - - // Month and day are the same, does not matter if YMD or YDM - '2015 01 1' => array( '+2015-01-01T00:00:00Z' ), - '2015 12 12' => array( '+2015-12-12T00:00:00Z' ), - - // Julian - '32-12-31' => array( '+0032-12-31T00:00:00Z', $julian ), - '31.12.32' => array( '+0032-12-31T00:00:00Z', $julian ), - '12/31/60' => array( '+0060-12-31T00:00:00Z', $julian ), - - // Negative years - '-2015-12-31' => array( '-2015-12-31T00:00:00Z', $julian ), - 'year -2015-12-31' => array( '-2015-12-31T00:00:00Z', $julian ), - '31 12 -2015' => array( '-2015-12-31T00:00:00Z', $julian ), - '12/31/-2015' => array( '-2015-12-31T00:00:00Z', $julian ), - '2015-12-31 BC' => array( '-2015-12-31T00:00:00Z', $julian ), - '31 12 2015 BC' => array( '-2015-12-31T00:00:00Z', $julian ), - '12/31/2015 BC' => array( '-2015-12-31T00:00:00Z', $julian ), - - // A negative number must be the year. - 'year -3-2-13' => array( '-0003-02-13T00:00:00Z', $julian ), - '13. 2. -3' => array( '-0003-02-13T00:00:00Z', $julian ), - '23:12:-59' => array( '-0059-12-23T00:00:00Z', $julian ), - ); - - $cases = array(); - - foreach ( $valid as $value => $args ) { - $timestamp = $args[0]; - $calendarModel = isset( $args[1] ) ? $args[1] : $gregorian; - - $cases[] = array( - // Because PHP magically turns numeric keys into ints/floats - (string)$value, - new TimeValue( $timestamp, 0, 0, 0, TimeValue::PRECISION_DAY, $calendarModel ) - ); - } - - return $cases; - } - - /** - * @see StringValueParserTest::invalidInputProvider - */ - public function invalidInputProvider() { - $invalid = array( - // This parser can only parse strings that contain exactly three numbers. - '2015', - '12.2015', - 'May 1 2015', - '1. May 2015', - '1 2015-12-31', - '31.12.2015 23', - '31.12.2015 23:59', - '+2015-12-31T00:00:00Z', - - // Can be confused with a time (HMS) - '12:31:59', - '12:59:59', - '23:12:59', - '23:12:31', - '-23:12:31', - '-24:00:00', - - // No year can be identified if all numbers are smaller than 32. - '12 12 12', - '31 12 12', - '12 31 12', - '31 31 12', - '12 12 31', - '31 12 31', - '12 31 31', - '31 31 31', - - // Two or more candidates for the year. - '32 32 12', - '32 12 32', - '12 32 32', - '32 32 32', - - // Year can be identified, but month and day can not be distinguished. - '32 2 1', - '2015-12-11', - '1 2 32', - '11.12.2015', - - // Formats DYM and MYD do not exist and should not be parsed. - '12 -1 12', - '12 32 12', - '12 2015 31', - '31 2015 12', - - // Duplicate era. - 'year -2015-12-31 BC', - '31.12.-2015 BC', - - // Zeros. - '-2015-00-00', - '0000-00-00', - '2015-00-00', - '2015-12-00', - '0. 0. -2015', - '0. 0. 0', - '0. 0. 2015', - '0. 12. 2015', - - // To long. - '2015-12-031', - '2015-012-31', - ); - - $cases = parent::invalidInputProvider(); - - foreach ( $invalid as $value ) { - $cases[] = array( $value ); - } - - return $cases; - } - - /** - * @dataProvider optionsProvider - */ - public function testOptions( - $value, - array $options, - $timestamp, - $calendarModel, - $precision = TimeValue::PRECISION_DAY - ) { - $parser = new YearMonthDayTimeParser( null, new ParserOptions( $options ) ); - $this->assertEquals( - new TimeValue( $timestamp, 0, 0, 0, $precision, $calendarModel ), - $parser->parse( $value ) - ); - } - - public function optionsProvider() { - $gregorian = 'http://www.wikidata.org/entity/Q1985727'; - $julian = 'http://www.wikidata.org/entity/Q1985786'; - - return array( - 'Auto-detected Gregorian' => array( - '1583-01-31', - array(), - '+1583-01-31T00:00:00Z', - $gregorian - ), - 'Option overrides auto-detected Gregorian' => array( - '1583-01-31', - array( IsoTimestampParser::OPT_CALENDAR => $julian ), - '+1583-01-31T00:00:00Z', - $julian - ), - 'Auto-detected Julian' => array( - '1582-01-31', - array(), - '+1582-01-31T00:00:00Z', - $julian - ), - 'Option overrides auto-detected Julian' => array( - '1582-01-31', - array( IsoTimestampParser::OPT_CALENDAR => $gregorian ), - '+1582-01-31T00:00:00Z', - $gregorian - ), - 'Option can decrease precision' => array( - '2016-01-31', - array( IsoTimestampParser::OPT_PRECISION => TimeValue::PRECISION_MONTH ), - '+2016-01-31T00:00:00Z', - $gregorian, - TimeValue::PRECISION_MONTH - ), - 'Option can set minimal precision' => array( - '2016-01-31', - array( IsoTimestampParser::OPT_PRECISION => TimeValue::PRECISION_YEAR1G ), - '+2016-01-31T00:00:00Z', - $gregorian, - TimeValue::PRECISION_YEAR1G - ), - 'Option can increase day precision' => array( - '2016-01-31', - array( IsoTimestampParser::OPT_PRECISION => TimeValue::PRECISION_HOUR ), - '+2016-01-31T00:00:00Z', - $gregorian, - TimeValue::PRECISION_HOUR - ), - 'Precision option accepts strings' => array( - '2016-01-31', - array( IsoTimestampParser::OPT_PRECISION => '10' ), - '+2016-01-31T00:00:00Z', - $gregorian, - TimeValue::PRECISION_MONTH - ), - ); - } - - /** - * @dataProvider invalidOptionsProvider - */ - public function testInvalidOptions( array $options ) { - $parser = new YearMonthDayTimeParser( null, new ParserOptions( $options ) ); - $this->setExpectedException( 'ValueParsers\ParseException' ); - $parser->parse( '2016-01-31' ); - } - - public function invalidOptionsProvider() { - return array( - array( array( IsoTimestampParser::OPT_PRECISION => -1 ) ), - array( array( IsoTimestampParser::OPT_PRECISION => 1.5 ) ), - array( array( IsoTimestampParser::OPT_PRECISION => 1000 ) ), - array( array( IsoTimestampParser::OPT_PRECISION => 'invalid' ) ), - ); - } - -} diff --git a/vendor/data-values/time/tests/ValueParsers/YearMonthTimeParserTest.php b/vendor/data-values/time/tests/ValueParsers/YearMonthTimeParserTest.php deleted file mode 100644 index a0c60c1..0000000 --- a/vendor/data-values/time/tests/ValueParsers/YearMonthTimeParserTest.php +++ /dev/null @@ -1,215 +0,0 @@ -<?php - -namespace ValueParsers\Test; - -use DataValues\TimeValue; -use ValueParsers\YearMonthTimeParser; - -/** - * @covers ValueParsers\YearMonthTimeParser - * - * @group DataValue - * @group DataValueExtensions - * @group TimeParsers - * @group ValueParsers - * - * @license GPL-2.0+ - * @author Addshore - * @author Thiemo Mättig - */ -class YearMonthTimeParserTest extends StringValueParserTest { - - /** - * @deprecated since DataValues Common 0.3, just use getInstance. - */ - protected function getParserClass() { - throw new \LogicException( 'Should not be called, use getInstance' ); - } - - /** - * @see ValueParserTestBase::getInstance - * - * @return YearMonthTimeParser - */ - protected function getInstance() { - $monthNameProvider = $this->getMockBuilder( 'ValueParsers\MonthNameProvider' ) - ->disableOriginalConstructor() - ->getMock(); - $monthNameProvider->expects( $this->once() ) - ->method( 'getMonthNumbers' ) - ->with( 'en' ) - ->will( $this->returnValue( array( - 'January' => 1, - 'Jan' => 1, - 'April' => 4, - 'June' => 6, - ) ) ); - - return new YearMonthTimeParser( $monthNameProvider ); - } - - /** - * @see ValueParserTestBase::validInputProvider - */ - public function validInputProvider() { - $gregorian = 'http://www.wikidata.org/entity/Q1985727'; - $julian = 'http://www.wikidata.org/entity/Q1985786'; - - $argLists = array(); - - $valid = array( - // Whitespace - "January 2016\n" => - array( '+2016-01-00T00:00:00Z' ), - ' January 2016 ' => - array( '+2016-01-00T00:00:00Z' ), - - // leading zeros - '1 00001999' => - array( '+1999-01-00T00:00:00Z' ), - '1 0000000100001999' => - array( '+100001999-01-00T00:00:00Z' ), - - // Negative years - '4 -1998' => - array( '-1998-04-00T00:00:00Z', TimeValue::PRECISION_MONTH, $julian ), - 'April -1998' => - array( '-1998-04-00T00:00:00Z', TimeValue::PRECISION_MONTH, $julian ), - '-1998 4' => - array( '-1998-04-00T00:00:00Z', TimeValue::PRECISION_MONTH, $julian ), - '-1998 April' => - array( '-1998-04-00T00:00:00Z', TimeValue::PRECISION_MONTH, $julian ), - - // use string month names - 'Jan/1999' => - array( '+1999-01-00T00:00:00Z' ), - 'January/1999' => - array( '+1999-01-00T00:00:00Z' ), - 'January/1' => - array( '+0001-01-00T00:00:00Z', TimeValue::PRECISION_MONTH, $julian ), - '1999 January' => - array( '+1999-01-00T00:00:00Z' ), - 'January 1999' => - array( '+1999-01-00T00:00:00Z' ), - 'January-1' => - array( '+0001-01-00T00:00:00Z', TimeValue::PRECISION_MONTH, $julian ), - 'JanuARY-1' => - array( '+0001-01-00T00:00:00Z', TimeValue::PRECISION_MONTH, $julian ), - 'JaN/1999' => - array( '+1999-01-00T00:00:00Z' ), - 'januARY-1' => - array( '+0001-01-00T00:00:00Z', TimeValue::PRECISION_MONTH, $julian ), - 'jan/1999' => - array( '+1999-01-00T00:00:00Z' ), - - // use different date separators - '1-1999' => - array( '+1999-01-00T00:00:00Z' ), - '1/1999' => - array( '+1999-01-00T00:00:00Z' ), - '1 / 1999' => - array( '+1999-01-00T00:00:00Z' ), - '1 1999' => - array( '+1999-01-00T00:00:00Z' ), - '1,1999' => - array( '+1999-01-00T00:00:00Z' ), - '1.1999' => - array( '+1999-01-00T00:00:00Z' ), - '1. 1999' => - array( '+1999-01-00T00:00:00Z' ), - - // presume mm/yy unless impossible month, in which case switch - '12/12' => - array( '+0012-12-00T00:00:00Z', TimeValue::PRECISION_MONTH, $julian ), - '12/11' => - array( '+0011-12-00T00:00:00Z', TimeValue::PRECISION_MONTH, $julian ), - '11/12' => - array( '+0012-11-00T00:00:00Z', TimeValue::PRECISION_MONTH, $julian ), - '13/12' => - array( '+0013-12-00T00:00:00Z', TimeValue::PRECISION_MONTH, $julian ), - '12/13' => - array( '+0013-12-00T00:00:00Z', TimeValue::PRECISION_MONTH, $julian ), - '2000 1' => - array( '+2000-01-00T00:00:00Z' ), - - // big years - 'April-1000000001' => - array( '+1000000001-04-00T00:00:00Z' ), - 'April 1000000001' => - array( '+1000000001-04-00T00:00:00Z' ), - '1000000001 April' => - array( '+1000000001-04-00T00:00:00Z' ), - '1 13000' => - array( '+13000-01-00T00:00:00Z' ), - - // parse 0 month as if no month has been entered - '0.1999' => - array( '+1999-00-00T00:00:00Z', TimeValue::PRECISION_YEAR ), - '1999 0' => - array( '+1999-00-00T00:00:00Z', TimeValue::PRECISION_YEAR ), - ); - - foreach ( $valid as $value => $expected ) { - $timestamp = $expected[0]; - $precision = isset( $expected[1] ) ? $expected[1] : TimeValue::PRECISION_MONTH; - $calendarModel = isset( $expected[2] ) ? $expected[2] : $gregorian; - - $argLists[] = array( - (string)$value, - new TimeValue( $timestamp, 0, 0, 0, $precision, $calendarModel ) - ); - } - - return $argLists; - } - - /** - * @see StringValueParserTest::invalidInputProvider - */ - public function invalidInputProvider() { - $argLists = parent::invalidInputProvider(); - - $invalid = array( - //These are just wrong! - 'June June June', - 'June June', - '111 111 111', - 'Jann 2014', - '13/13', - '13,1999', - '1999,13', - "12 1950\n12", - - // Months with signs or more than two digits are most probably not a month - '-0 1999', - '-4 1999', - '-4 -1999', - '-April 1998', - '000 1999', - '012 1999', - '00001 1999', - '000000001 100001999', - - //Dont parse stuff with separators in the year - 'june 200,000,000', - 'june 200.000.000', - - //Not within the scope of this parser - '1 June 20000', - '20000', - '-1998', - - // BCE is not supported yet - 'April 1998 BCE', - '1998 April BCE', - '1998 BCE April', - ); - - foreach ( $invalid as $value ) { - $argLists[] = array( $value ); - } - - return $argLists; - } - -} diff --git a/vendor/data-values/time/tests/ValueParsers/YearTimeParserTest.php b/vendor/data-values/time/tests/ValueParsers/YearTimeParserTest.php deleted file mode 100644 index 4fb1798..0000000 --- a/vendor/data-values/time/tests/ValueParsers/YearTimeParserTest.php +++ /dev/null @@ -1,181 +0,0 @@ -<?php - -namespace ValueParsers\Test; - -use DataValues\TimeValue; -use ValueParsers\EraParser; -use ValueParsers\ParserOptions; -use ValueParsers\YearTimeParser; - -/** - * @covers ValueParsers\YearTimeParser - * - * @group DataValue - * @group DataValueExtensions - * @group TimeParsers - * @group ValueParsers - * - * @license GPL-2.0+ - * @author Addshore - * @author Thiemo Mättig - */ -class YearTimeParserTest extends StringValueParserTest { - - /** - * @deprecated since DataValues Common 0.3, just use getInstance. - */ - protected function getParserClass() { - throw new \LogicException( 'Should not be called, use getInstance' ); - } - - /** - * @see ValueParserTestBase::getInstance - * - * @return YearTimeParser - */ - protected function getInstance() { - return new YearTimeParser( $this->getMockEraParser() ); - } - - /** - * @return EraParser - */ - private function getMockEraParser() { - $mock = $this->getMockBuilder( 'ValueParsers\EraParser' ) - ->disableOriginalConstructor() - ->getMock(); - $mock->expects( $this->any() ) - ->method( 'parse' ) - ->with( $this->isType( 'string' ) ) - ->will( $this->returnCallback( - function( $value ) { - $sign = '+'; - // Tiny parser that supports a single negative sign only - if ( $value[0] === '-' ) { - $sign = '-'; - $value = substr( $value, 1 ); - } - return array( $sign, $value ); - } - ) ); - return $mock; - } - - /** - * @see ValueParserTestBase::validInputProvider - */ - public function validInputProvider() { - $gregorian = 'http://www.wikidata.org/entity/Q1985727'; - $julian = 'http://www.wikidata.org/entity/Q1985786'; - - $argLists = array(); - - $valid = array( - '1999' => - array( '+1999-00-00T00:00:00Z' ), - '2000' => - array( '+2000-00-00T00:00:00Z' ), - '2010' => - array( '+2010-00-00T00:00:00Z' ), - '2000000' => - array( '+2000000-00-00T00:00:00Z', TimeValue::PRECISION_YEAR1M ), - '2000000000' => - array( '+2000000000-00-00T00:00:00Z', TimeValue::PRECISION_YEAR1G ), - '2000020000' => - array( '+2000020000-00-00T00:00:00Z', TimeValue::PRECISION_YEAR10K ), - '2000001' => - array( '+2000001-00-00T00:00:00Z' ), - '02000001' => - array( '+2000001-00-00T00:00:00Z' ), - '1' => - array( '+0001-00-00T00:00:00Z', TimeValue::PRECISION_YEAR, $julian ), - '000000001' => - array( '+0001-00-00T00:00:00Z', TimeValue::PRECISION_YEAR, $julian ), - '-1000000' => - array( '-1000000-00-00T00:00:00Z', TimeValue::PRECISION_YEAR1M, $julian ), - '-1 000 000' => - array( '-1000000-00-00T00:00:00Z', TimeValue::PRECISION_YEAR1M, $julian ), - '-19_000' => - array( '-19000-00-00T00:00:00Z', TimeValue::PRECISION_YEAR1K, $julian ), - // Digit grouping in the Indian numbering system - '-1,99,999' => - array( '-199999-00-00T00:00:00Z', TimeValue::PRECISION_YEAR, $julian ), - ); - - foreach ( $valid as $value => $expected ) { - $timestamp = $expected[0]; - $precision = isset( $expected[1] ) ? $expected[1] : TimeValue::PRECISION_YEAR; - $calendarModel = isset( $expected[2] ) ? $expected[2] : $gregorian; - - $argLists[] = array( - (string)$value, - new TimeValue( $timestamp, 0, 0, 0, $precision, $calendarModel ) - ); - } - - return $argLists; - } - - public function testDigitGroupSeparatorOption() { - $options = new ParserOptions(); - $options->setOption( YearTimeParser::OPT_DIGIT_GROUP_SEPARATOR, '.' ); - $parser = new YearTimeParser( null, $options ); - $timeValue = $parser->parse( '-19.000' ); - $this->assertSame( '-19000-00-00T00:00:00Z', $timeValue->getTime() ); - } - - /** - * @see StringValueParserTest::invalidInputProvider - */ - public function invalidInputProvider() { - $argLists = parent::invalidInputProvider(); - - $invalid = array( - // This should fail with an era parser that does no trimming - "2016\n", - - //These are just wrong! - 'June June June', - '111 111 111', - 'Jann 2014', - - //Not within the scope of this parser - '1 July 20000', - - //We should not try to parse these, this just gets confusing - '-100BC', - '+100BC', - '-100 BC', - '+100 BC', - '+100 BCE', - '+100BCE', - - // Non-default and invalid thousands separators - '-,999', - '-999,', - '-19.000', - '-1/000/000', - - // Positive years are unlikely to have thousands separators, it's more likely a date - '1 000 000', - '19_000', - '1,99,999', - ); - - foreach ( $invalid as $value ) { - $argLists[] = array( $value ); - } - - return $argLists; - } - - /** - * @expectedException \ValueParsers\ParseException - * @expectedExceptionMessage Failed to parse year - */ - public function testParseExceptionMessage() { - $parser = $this->getInstance(); - $parser->parse( 'ju5t 1nval1d' ); - } - -} diff --git a/vendor/data-values/time/tests/bootstrap.php b/vendor/data-values/time/tests/bootstrap.php deleted file mode 100644 index 0e2d07c..0000000 --- a/vendor/data-values/time/tests/bootstrap.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -if ( PHP_SAPI !== 'cli' ) { - die( 'Not an entry point' ); -} - -error_reporting( E_ALL | E_STRICT ); -ini_set( 'display_errors', 1 ); - -if ( !is_readable( __DIR__ . '/../vendor/autoload.php' ) ) { - die( 'You need to install this package with Composer before you can run the tests' ); -} - -require_once( __DIR__ . '/../vendor/autoload.php' ); -- To view, visit https://gerrit.wikimedia.org/r/377045 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I20e912662da9e8e326cad8d82aad4fb5b0a9e625 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikidata Gerrit-Branch: master Gerrit-Owner: WikidataBuilder <wikidata-servi...@wikimedia.de> Gerrit-Reviewer: Aude <aude.w...@gmail.com> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits