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

Change subject: Removes references to QuantityValue from SnakTest.
......................................................................


Removes references to QuantityValue from SnakTest.

This makes the SnakTest robust against the refactoring of
QuantityValue, as proposed in I1d1cb7367d7de.

Change-Id: Ie7f15f3585fda7245824712d2592c737cc1294f8
---
M tests/phpunit/Snak/SnakTest.php
1 file changed, 20 insertions(+), 12 deletions(-)

Approvals:
  Tobias Gritschacher: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/tests/phpunit/Snak/SnakTest.php b/tests/phpunit/Snak/SnakTest.php
index 3204b48..52b2e4f 100644
--- a/tests/phpunit/Snak/SnakTest.php
+++ b/tests/phpunit/Snak/SnakTest.php
@@ -2,8 +2,16 @@
 
 namespace Wikibase\Test;
 
+use DataValues\GlobeCoordinateValue;
+use DataValues\LatLongValue;
+use DataValues\NumberValue;
+use DataValues\StringValue;
 use Wikibase\DataModel\Entity\PropertyId;
+use Wikibase\PropertyNoValueSnak;
+use Wikibase\PropertySomeValueSnak;
+use Wikibase\PropertyValueSnak;
 use Wikibase\Snak;
+use Wikibase\SnakObject;
 
 /**
  * Unit tests for classes that implement Wikibase\Snak.
@@ -28,18 +36,18 @@
 
                $id42 = new PropertyId( 'p42' );
 
-               $snaks[] = new \Wikibase\PropertyNoValueSnak( $id42 );
+               $snaks[] = new PropertyNoValueSnak( $id42 );
 
-               $snaks[] = new \Wikibase\PropertySomeValueSnak( $id42 );
+               $snaks[] = new PropertySomeValueSnak( $id42 );
 
                $values = array();
 
-               $values[] = new \DataValues\StringValue( 'Ohi there!' );
-               $values[] = new \DataValues\NumberValue( 42 );
-               $values[] = new \DataValues\QuantityValue( 4.2, 'm', 1 );
+               $values[] = new StringValue( 'Ohi there!' );
+               $values[] = new NumberValue( 42 );
+               $values[] = new GlobeCoordinateValue( new LatLongValue( 4.2, 
4.2 ), 1 );
 
                foreach ( $values as $value ) {
-                       $snaks[] = new \Wikibase\PropertyValueSnak( $id42, 
$value );
+                       $snaks[] = new PropertyValueSnak( $id42, $value );
                }
 
                $argLists = array();
@@ -105,18 +113,18 @@
        public function testEqualsMoar() {
                $id42 = new PropertyId( 'p42' );
 
-               $snak = new \Wikibase\PropertyNoValueSnak( $id42 );
+               $snak = new PropertyNoValueSnak( $id42 );
 
-               $this->assertFalse( $snak->equals( new 
\Wikibase\PropertySomeValueSnak( $id42 ) ) );
+               $this->assertFalse( $snak->equals( new PropertySomeValueSnak( 
$id42 ) ) );
 
-               $this->assertFalse( $snak->equals( new 
\Wikibase\PropertyValueSnak(
+               $this->assertFalse( $snak->equals( new PropertyValueSnak(
                        $id42,
-                       new \DataValues\StringValue( 'Ohi there!' )
+                       new StringValue( 'Ohi there!' )
                ) ) );
 
                $id43 = new PropertyId( 'p43' );
 
-               $this->assertFalse( $snak->equals( new 
\Wikibase\PropertyNoValueSnak( $id43 ) ) );
+               $this->assertFalse( $snak->equals( new PropertyNoValueSnak( 
$id43 ) ) );
        }
 
        /**
@@ -130,7 +138,7 @@
                $this->assertInternalType( 'array', $array, 'toArray should 
return array' );
 
                foreach ( array( $array, unserialize( $serialization ) ) as 
$data ) {
-                       $copy = \Wikibase\SnakObject::newFromArray( $data );
+                       $copy = SnakObject::newFromArray( $data );
 
                        $this->assertInstanceOf( '\Wikibase\Snak', $copy, 
'newFromArray should return object implementing Snak' );
                        $this->assertEquals( $snak->getHash(), 
$copy->getHash(), 'newFromArray should return object with same Hash used 
previously' );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie7f15f3585fda7245824712d2592c737cc1294f8
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/WikibaseDataModel
Gerrit-Branch: master
Gerrit-Owner: Daniel Kinzler <daniel.kinz...@wikimedia.de>
Gerrit-Reviewer: Tobias Gritschacher <tobias.gritschac...@wikimedia.de>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to