Merge "Type hint against LinkTarget in WatchedItemStore"
[lhc/web/wiklou.git] / tests / phpunit / includes / db / LBFactoryTest.php
index f7007e7..424c64b 100644 (file)
@@ -302,6 +302,8 @@ class LBFactoryTest extends MediaWikiTestCase {
                        ->getMock();
                $lb1->method( 'getConnection' )->willReturn( $mockDB1 );
                $lb1->method( 'getServerCount' )->willReturn( 2 );
+               $lb1->method( 'hasReplicaServers' )->willReturn( true );
+               $lb1->method( 'hasStreamingReplicaServers' )->willReturn( true );
                $lb1->method( 'getAnyOpenConnection' )->willReturn( $mockDB1 );
                $lb1->method( 'hasOrMadeRecentMasterChanges' )->will( $this->returnCallback(
                                function () use ( $mockDB1 ) {
@@ -313,6 +315,7 @@ class LBFactoryTest extends MediaWikiTestCase {
                                }
                        ) );
                $lb1->method( 'getMasterPos' )->willReturn( $m1Pos );
+               $lb1->method( 'getReplicaResumePos' )->willReturn( $m1Pos );
                $lb1->method( 'getServerName' )->with( 0 )->willReturn( 'master1' );
                // Master DB 2
                $mockDB2 = $this->getMockBuilder( IDatabase::class )
@@ -327,6 +330,8 @@ class LBFactoryTest extends MediaWikiTestCase {
                        ->getMock();
                $lb2->method( 'getConnection' )->willReturn( $mockDB2 );
                $lb2->method( 'getServerCount' )->willReturn( 2 );
+               $lb2->method( 'hasReplicaServers' )->willReturn( true );
+               $lb2->method( 'hasStreamingReplicaServers' )->willReturn( true );
                $lb2->method( 'getAnyOpenConnection' )->willReturn( $mockDB2 );
                $lb2->method( 'hasOrMadeRecentMasterChanges' )->will( $this->returnCallback(
                        function () use ( $mockDB2 ) {
@@ -338,6 +343,7 @@ class LBFactoryTest extends MediaWikiTestCase {
                        }
                ) );
                $lb2->method( 'getMasterPos' )->willReturn( $m2Pos );
+               $lb2->method( 'getReplicaResumePos' )->willReturn( $m2Pos );
                $lb2->method( 'getServerName' )->with( 0 )->willReturn( 'master2' );
 
                $bag = new HashBagOStuff();
@@ -373,6 +379,8 @@ class LBFactoryTest extends MediaWikiTestCase {
                        ->disableOriginalConstructor()
                        ->getMock();
                $lb1->method( 'getServerCount' )->willReturn( 2 );
+               $lb1->method( 'hasReplicaServers' )->willReturn( true );
+               $lb1->method( 'hasStreamingReplicaServers' )->willReturn( true );
                $lb1->method( 'getServerName' )->with( 0 )->willReturn( 'master1' );
                $lb1->expects( $this->once() )
                        ->method( 'waitFor' )->with( $this->equalTo( $m1Pos ) );
@@ -381,6 +389,8 @@ class LBFactoryTest extends MediaWikiTestCase {
                        ->disableOriginalConstructor()
                        ->getMock();
                $lb2->method( 'getServerCount' )->willReturn( 2 );
+               $lb2->method( 'hasReplicaServers' )->willReturn( true );
+               $lb2->method( 'hasStreamingReplicaServers' )->willReturn( true );
                $lb2->method( 'getServerName' )->with( 0 )->willReturn( 'master2' );
                $lb2->expects( $this->once() )
                        ->method( 'waitFor' )->with( $this->equalTo( $m2Pos ) );