- $store = $this->newWatchedItemStore(
- $this->getMockLBFactory( $mockDb ),
- $mockQueueGroup,
- $mockCache,
- $this->getMockReadOnlyMode()
- );
+
+ $mockRevision = $this->createMock( RevisionRecord::class );
+ $mockRevision->expects( $this->never() )->method( $this->anything() );
+
+ $mockNextRevision = $this->createMock( RevisionRecord::class );
+ $mockNextRevision->expects( $this->never() )->method( $this->anything() );
+
+ $mockRevisionLookup = $this->getMockRevisionLookup(
+ [
+ 'getTimestampFromId' => function ( $oldidParam ) use ( $oldid ) {
+ $this->assertEquals( $oldid, $oldidParam );
+ },
+ 'getRevisionById' => function ( $id ) use ( $oldid, $mockRevision ) {
+ $this->assertSame( $oldid, $id );
+ return $mockRevision;
+ },
+ 'getNextRevision' =>
+ function ( RevisionRecord $rev ) use ( $mockRevision, $mockNextRevision ) {
+ $this->assertSame( $mockRevision, $rev );
+ return $mockNextRevision;
+ },
+ ],
+ [
+ 'getTimestampFromId' => 2,
+ 'getRevisionById' => 1,
+ 'getNextRevision' => 1,
+ ]
+ );
+ $store = $this->newWatchedItemStore( [
+ 'db' => $mockDb,
+ 'queueGroup' => $mockQueueGroup,
+ 'cache' => $mockCache,
+ 'revisionLookup' => $mockRevisionLookup,
+ ] );