Jeroen De Dauw has submitted this change and it was merged.

Change subject: Stop using deprecated contentfactory singleton
......................................................................


Stop using deprecated contentfactory singleton

Change-Id: I85adf70899789b6f48cae92ea36e57a351081a77
---
M repo/tests/phpunit/includes/api/CreateClaimTest.php
M repo/tests/phpunit/includes/api/EditPageTest.php
2 files changed, 5 insertions(+), 4 deletions(-)

Approvals:
  Jeroen De Dauw: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/repo/tests/phpunit/includes/api/CreateClaimTest.php 
b/repo/tests/phpunit/includes/api/CreateClaimTest.php
index eba5a7b..ac9bc4b 100644
--- a/repo/tests/phpunit/includes/api/CreateClaimTest.php
+++ b/repo/tests/phpunit/includes/api/CreateClaimTest.php
@@ -82,7 +82,7 @@
 
                $this->assertEquals( 'value', $claim['mainsnak']['snaktype'] );
 
-               $entityContent = 
\Wikibase\EntityContentFactory::singleton()->getFromId( $entity->getId() );
+               $entityContent = 
WikibaseRepo::getDefaultInstance()->getEntityContentFactory()->getFromId( 
$entity->getId() );
 
                $claims = new \Wikibase\Claims( 
$entityContent->getEntity()->getClaims() );
 
@@ -226,7 +226,7 @@
                        $this->assertEquals( $errorCode, $e->getCodeString(), 
'Invalid request raised correct error' );
                }
 
-               $entityContent = 
\Wikibase\EntityContentFactory::singleton()->getFromId( $entity->getId() );
+               $entityContent = 
WikibaseRepo::getDefaultInstance()->getEntityContentFactory()->getFromId( 
$entity->getId() );
 
                $this->assertFalse( $entityContent->getEntity()->hasClaims() );
        }
@@ -280,7 +280,7 @@
 
                $this->assertNotEquals( $firstGuid, $secondGuid );
 
-               $entityContent = 
\Wikibase\EntityContentFactory::singleton()->getFromId( $entity->getId() );
+               $entityContent = 
WikibaseRepo::getDefaultInstance()->getEntityContentFactory()->getFromId( 
$entity->getId() );
 
                $claims = new \Wikibase\Claims( 
$entityContent->getEntity()->getClaims() );
 
diff --git a/repo/tests/phpunit/includes/api/EditPageTest.php 
b/repo/tests/phpunit/includes/api/EditPageTest.php
index 7ac88e6..5719f1f 100644
--- a/repo/tests/phpunit/includes/api/EditPageTest.php
+++ b/repo/tests/phpunit/includes/api/EditPageTest.php
@@ -2,6 +2,7 @@
 
 namespace Wikibase\Test\Api;
 use ApiTestCase;
+use Wikibase\Repo\WikibaseRepo;
 
 /**
  * Tests for blocking of direct editing.
@@ -80,7 +81,7 @@
                global $wgContentHandlerUseDB;
 
                $id = new \Wikibase\EntityId( \Wikibase\Item::ENTITY_TYPE, 
1234567 );
-               $page = 
\Wikibase\EntityContentFactory::singleton()->getWikiPageForId( $id );
+               $page = 
WikibaseRepo::getDefaultInstance()->getEntityContentFactory()->getWikiPageForId(
 $id );
 
                $text = "hallo welt";
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I85adf70899789b6f48cae92ea36e57a351081a77
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Addshore <addshorew...@gmail.com>
Gerrit-Reviewer: Jeroen De Dauw <jeroended...@gmail.com>
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