+ private function getWANObjectCache() {
+ return new WANObjectCache( [ 'cache' => new HashBagOStuff() ] );
+ }
+
+ /**
+ * @return SqlBlobStore
+ */
+ private function getBlobStore() {
+ /** @var LoadBalancer $lb */
+ $lb = $this->getMockBuilder( LoadBalancer::class )
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ $cache = $this->getWANObjectCache();
+
+ $blobStore = new SqlBlobStore( $lb, $cache );
+ return $blobStore;
+ }
+
+ private function mockBlobStoreFactory( $blobStore ) {
+ /** @var LoadBalancer $lb */
+ $factory = $this->getMockBuilder( BlobStoreFactory::class )
+ ->disableOriginalConstructor()
+ ->getMock();
+ $factory->expects( $this->any() )
+ ->method( 'newBlobStore' )
+ ->willReturn( $blobStore );
+ $factory->expects( $this->any() )
+ ->method( 'newSqlBlobStore' )
+ ->willReturn( $blobStore );
+ return $factory;
+ }
+
+ /**
+ * @return RevisionStore
+ */
+ private function getRevisionStore() {
+ /** @var LoadBalancer $lb */
+ $lb = $this->getMockBuilder( LoadBalancer::class )
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ $cache = $this->getWANObjectCache();
+
+ $blobStore = new RevisionStore( $lb, $this->getBlobStore(), $cache );
+ return $blobStore;
+ }
+