Merge "Follow-up 8697ba8: No need for two dependencies on the same module"
[lhc/web/wiklou.git] / tests / phpunit / includes / RevisionTest.php
index 98f2980..ed4a27f 100644 (file)
@@ -281,7 +281,6 @@ class RevisionTest extends MediaWikiTestCase {
         * @covers \MediaWiki\Revision\RevisionStore::newMutableRevisionFromArray
         */
        public function testConstructFromRowWithBadPageId() {
-               $this->overrideMwServices();
                Wikimedia\suppressWarnings();
                $rev = new Revision( (object)[
                        'rev_page' => 77777777,
@@ -438,10 +437,11 @@ class RevisionTest extends MediaWikiTestCase {
                $lb = $this->getMockBuilder( LoadBalancer::class )
                        ->disableOriginalConstructor()
                        ->getMock();
-
+               $access = MediaWikiServices::getInstance()->getExternalStoreAccess();
                $cache = $this->getWANObjectCache();
 
-               $blobStore = new SqlBlobStore( $lb, $cache );
+               $blobStore = new SqlBlobStore( $lb, $access, $cache );
+
                return $blobStore;
        }
 
@@ -601,8 +601,6 @@ class RevisionTest extends MediaWikiTestCase {
         * @covers Revision::loadFromTitle
         */
        public function testLoadFromTitle() {
-               $this->setMwGlobals( 'wgActorTableSchemaMigrationStage', SCHEMA_COMPAT_NEW );
-               $this->overrideMwServices();
                $title = $this->getMockTitle();
 
                $conditions = [
@@ -807,7 +805,7 @@ class RevisionTest extends MediaWikiTestCase {
        public function testGetRevisionText_external_noOldId() {
                $this->setService(
                        'ExternalStoreFactory',
-                       new ExternalStoreFactory( [ 'ForTesting' ] )
+                       new ExternalStoreFactory( [ 'ForTesting' ], [ 'ForTesting://cluster1' ], 'test-id' )
                );
                $this->assertSame(
                        'AAAABBAAA',
@@ -829,14 +827,15 @@ class RevisionTest extends MediaWikiTestCase {
 
                $this->setService(
                        'ExternalStoreFactory',
-                       new ExternalStoreFactory( [ 'ForTesting' ] )
+                       new ExternalStoreFactory( [ 'ForTesting' ], [ 'ForTesting://cluster1' ], 'test-id' )
                );
 
                $lb = $this->getMockBuilder( LoadBalancer::class )
                        ->disableOriginalConstructor()
                        ->getMock();
+               $access = MediaWikiServices::getInstance()->getExternalStoreAccess();
 
-               $blobStore = new SqlBlobStore( $lb, $cache );
+               $blobStore = new SqlBlobStore( $lb, $access, $cache );
                $this->setService( 'BlobStoreFactory', $this->mockBlobStoreFactory( $blobStore ) );
 
                $this->assertSame(