Daniel Kinzler has uploaded a new change for review.

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

Change subject: Require DataValues Number 0.8.2
......................................................................

Require DataValues Number 0.8.2

Change-Id: I2cd088e09649113f2bbbb810d23419b3f6cd8a97
(cherry picked from commit ac302b77bab913cad7d409dbed1eb1b6358d7004)
---
M 
client/tests/phpunit/includes/DataAccess/DataAccessSnakFormatterOutputFormatTest.php
M composer.json
M lib/includes/Formatters/QuantityDetailsFormatter.php
M lib/tests/phpunit/Formatters/WikibaseValueFormatterBuildersTest.php
M repo/tests/phpunit/includes/Api/FormatSnakValueTest.php
5 files changed, 8 insertions(+), 6 deletions(-)


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

diff --git 
a/client/tests/phpunit/includes/DataAccess/DataAccessSnakFormatterOutputFormatTest.php
 
b/client/tests/phpunit/includes/DataAccess/DataAccessSnakFormatterOutputFormatTest.php
index 744b1b8..b184f72 100644
--- 
a/client/tests/phpunit/includes/DataAccess/DataAccessSnakFormatterOutputFormatTest.php
+++ 
b/client/tests/phpunit/includes/DataAccess/DataAccessSnakFormatterOutputFormatTest.php
@@ -136,7 +136,7 @@
                                )
                        ],
                        'quantity' => [
-                               '42 a [[b]] c',
+                               '42±0 a [[b]] c',
                                new PropertyValueSnak(
                                        $p4,
                                        new QuantityValue(
@@ -148,7 +148,7 @@
                                )
                        ],
                        'quantity with unit' => [
-                               '42 label [[with]] wikitext',
+                               '42±0 label [[with]] wikitext',
                                new PropertyValueSnak(
                                        $p4,
                                        new QuantityValue(
diff --git a/composer.json b/composer.json
index eeabaaa..7710f54 100644
--- a/composer.json
+++ b/composer.json
@@ -26,7 +26,7 @@
                "data-values/common": "~0.3.0",
                "data-values/geo": "~1.0",
                "data-values/interfaces": "~0.2.0|~0.1.5",
-               "data-values/number": "~0.8.1",
+               "data-values/number": "~0.8.2",
                "data-values/time": "~0.8.4",
                "data-values/validators": "~0.1.0",
                "data-values/data-types": "~0.5.0",
diff --git a/lib/includes/Formatters/QuantityDetailsFormatter.php 
b/lib/includes/Formatters/QuantityDetailsFormatter.php
index 33827f5..1e75ef0 100644
--- a/lib/includes/Formatters/QuantityDetailsFormatter.php
+++ b/lib/includes/Formatters/QuantityDetailsFormatter.php
@@ -126,7 +126,7 @@
         */
        private function formatNumber( DecimalValue $number, $unit ) {
                return htmlspecialchars( $this->numberFormatter->format(
-                       new QuantityValue( $number, $unit, $number, $number )
+                       new UnboundedQuantityValue( $number, $unit )
                ) );
        }
 
diff --git 
a/lib/tests/phpunit/Formatters/WikibaseValueFormatterBuildersTest.php 
b/lib/tests/phpunit/Formatters/WikibaseValueFormatterBuildersTest.php
index 4f7b812..87e7731 100644
--- a/lib/tests/phpunit/Formatters/WikibaseValueFormatterBuildersTest.php
+++ b/lib/tests/phpunit/Formatters/WikibaseValueFormatterBuildersTest.php
@@ -9,6 +9,7 @@
 use DataValues\QuantityValue;
 use DataValues\StringValue;
 use DataValues\TimeValue;
+use DataValues\UnboundedQuantityValue;
 use DataValues\UnDeserializableValue;
 use Language;
 use MediaWikiTestCase;
@@ -306,7 +307,7 @@
                                'Quantity',
                                SnakFormatter::FORMAT_PLAIN,
                                $this->newFormatterOptions( 'de' ),
-                               QuantityValue::newFromNumber( '+123456.789' ),
+                               UnboundedQuantityValue::newFromNumber( 
'+123456.789' ),
                                '@^123\\.456,789$@'
                        ),
                        'quantity details' => array(
diff --git a/repo/tests/phpunit/includes/Api/FormatSnakValueTest.php 
b/repo/tests/phpunit/includes/Api/FormatSnakValueTest.php
index a68f6c5..4c38584 100644
--- a/repo/tests/phpunit/includes/Api/FormatSnakValueTest.php
+++ b/repo/tests/phpunit/includes/Api/FormatSnakValueTest.php
@@ -8,6 +8,7 @@
 use DataValues\StringValue;
 use DataValues\TimeValue;
 use ApiUsageException;
+use DataValues\UnboundedQuantityValue;
 use UsageException;
 use Wikibase\DataModel\Entity\EntityIdValue;
 use Wikibase\DataModel\Entity\Item;
@@ -101,7 +102,7 @@
                                '@^http://acme\.test$@'
                        ),
                        array(
-                               QuantityValue::newFromNumber( '+12.33', '1' ),
+                               UnboundedQuantityValue::newFromNumber( '+12.33' 
),
                                'quantity',
                                SnakFormatter::FORMAT_PLAIN,
                                array( 'lang' => 'de' ),

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2cd088e09649113f2bbbb810d23419b3f6cd8a97
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: wmf/1.29.0-wmf.3
Gerrit-Owner: Daniel Kinzler <[email protected]>
Gerrit-Reviewer: Thiemo Mättig (WMDE) <[email protected]>

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

Reply via email to