Thiemo Mättig (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/371637 )

Change subject: Remove a bit of unused code from EntityAccessorTest
......................................................................

Remove a bit of unused code from EntityAccessorTest

Change-Id: Iec504805a16b505e5e6778ec5930c66c4e91608b
---
M client/tests/phpunit/includes/DataAccess/Scribunto/EntityAccessorTest.php
1 file changed, 13 insertions(+), 14 deletions(-)


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

diff --git 
a/client/tests/phpunit/includes/DataAccess/Scribunto/EntityAccessorTest.php 
b/client/tests/phpunit/includes/DataAccess/Scribunto/EntityAccessorTest.php
index 67c50c1..b3454f8 100644
--- a/client/tests/phpunit/includes/DataAccess/Scribunto/EntityAccessorTest.php
+++ b/client/tests/phpunit/includes/DataAccess/Scribunto/EntityAccessorTest.php
@@ -16,13 +16,12 @@
 use Wikibase\DataModel\Entity\ItemId;
 use Wikibase\DataModel\Entity\ItemIdParser;
 use Wikibase\DataModel\Entity\PropertyId;
-use Wikibase\DataModel\ReferenceList;
 use Wikibase\DataModel\SerializerFactory;
 use Wikibase\DataModel\Services\Lookup\EntityLookup;
 use Wikibase\DataModel\Services\Lookup\PropertyDataTypeLookup;
 use Wikibase\DataModel\Snak\PropertySomeValueSnak;
 use Wikibase\DataModel\Snak\PropertyValueSnak;
-use Wikibase\DataModel\Snak\SnakList;
+use Wikibase\DataModel\Statement\Statement;
 use Wikibase\LanguageFallbackChainFactory;
 use Wikibase\Lib\StaticContentLanguages;
 use Wikibase\Lib\Tests\MockRepository;
@@ -231,22 +230,20 @@
                $item->setDescription( 'en', 'en-desc' );
                $item->setDescription( 'pt', 'ptDesc' );
                $item->getSiteLinkList()->addNewSiteLink( 'enwiki', 'Berlin', [ 
new ItemId( 'Q333' ) ] );
-               $item->getSiteLinkList()->addNewSiteLink( 'zh_classicalwiki', 
'User:Addshore', [] );
+               $item->getSiteLinkList()->addNewSiteLink( 'zh_classicalwiki', 
'User:Addshore' );
 
-               $snak = new PropertyValueSnak( $p65, new StringValue( 
'snakStringValue' ) );
+               $statement = new Statement( new PropertyValueSnak( $p65, new 
StringValue( 'snakStringValue' ) ) );
 
-               $qualifiers = new SnakList();
-               $qualifiers->addSnak( new PropertyValueSnak( $p65, new 
StringValue( 'string!' ) ) );
-               $qualifiers->addSnak( new PropertySomeValueSnak( $p65 ) );
+               $statement->getQualifiers()->addSnak( new PropertyValueSnak( 
$p65, new StringValue( 'string!' ) ) );
+               $statement->getQualifiers()->addSnak( new 
PropertySomeValueSnak( $p65 ) );
 
-               $references = new ReferenceList();
-               $references->addNewReference( [
+               $statement->addNewReference( [
                        new PropertySomeValueSnak( $p65 ),
                        new PropertySomeValueSnak( $p68 )
                ] );
 
-               $guid = 'imaguid';
-               $item->getStatements()->addNewStatement( $snak, $qualifiers, 
$references, $guid );
+               $statement->setGuid( 'imaguid' );
+               $item->getStatements()->addStatement( $statement );
 
                return $item;
        }
@@ -368,18 +365,20 @@
        public function testGetEntityStatementBadProperty() {
                $entityLookup = new MockRepository();
                $entityAccessor = $this->getEntityAccessor( $entityLookup );
+
                $this->setExpectedException( InvalidArgumentException::class );
-               $actual = $entityAccessor->getEntityStatement( 'Q123099', 
'ffsdfs' );
+               $entityAccessor->getEntityStatement( 'Q123099', 'ffsdfs' );
        }
 
        public function testGetEntityStatementMissingStatement() {
-               $entityLookup = new MockRepository();
                $item = new Item( new ItemId( 'Q123099' ) );
                $entityLookup = new MockRepository();
                $entityLookup->putEntity( $item );
                $entityAccessor = $this->getEntityAccessor( $entityLookup );
+
                $actual = $entityAccessor->getEntityStatement( 'Q123099', 'P13' 
);
-               $this->assertEquals( [], $actual );
+
+               $this->assertSame( [], $actual );
        }
 
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iec504805a16b505e5e6778ec5930c66c4e91608b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) <thiemo.maet...@wikimedia.de>

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

Reply via email to