getDummyDBLoadBalancerFactory(); $blockRestrictionStore = $this->createMock( BlockRestrictionStore::class ); $blockRestrictionStoreFactory = $this->createMock( BlockRestrictionStoreFactory::class ); $blockRestrictionStoreFactory ->method( 'getBlockRestrictionStore' ) ->with( $domain ) ->willReturn( $blockRestrictionStore ); $blockUtils = $this->createMock( BlockUtils::class ); $blockUtilsFactory = $this->createMock( BlockUtilsFactory::class ); $blockUtilsFactory ->method( 'getBlockUtils' ) ->with( $domain ) ->willReturn( $blockUtils ); $factory = new DatabaseBlockStoreFactory( new ServiceOptions( DatabaseBlockStore::CONSTRUCTOR_OPTIONS, new HashConfig( array_fill_keys( DatabaseBlockStore::CONSTRUCTOR_OPTIONS, null ) ) ), new NullLogger(), $this->createMock( ActorStoreFactory::class ), $blockRestrictionStoreFactory, $this->createMock( CommentStore::class ), $this->createMock( HookContainer::class ), $lbFactory, $this->createMock( ReadOnlyMode::class ), $this->createMock( UserFactory::class ), $this->createMock( TempUserConfig::class ), $blockUtilsFactory, $this->createMock( AutoblockExemptionList::class ) ); $databaseBlockStore = $factory->getDatabaseBlockStore( $domain ); $this->assertInstanceOf( DatabaseBlockStore::class, $databaseBlockStore ); } public static function provideDomains() { yield 'local wiki' => [ WikiAwareEntity::LOCAL ]; yield 'foreign wiki' => [ 'meta' ]; } }