* Deprecate and stop using $wgBlockTargetMigrationStage. Remove block_target migration code. * Make the $schema parameters to DatabaseBlockStore methods default to SCHEMA_BLOCK. Avoid passing these parameters where possible. * Remove cleanupBlocks.php * Deprecate DatabaseBlock static methods which try to present the old schema for b/c. Bug: T362133 Change-Id: I845bad8cc09a4528fef46a6f9d490ebdec881d99
38 lines
1 KiB
PHP
38 lines
1 KiB
PHP
<?php
|
|
|
|
namespace MediaWiki\Tests\Block;
|
|
|
|
use MediaWiki\Block\BlockRestrictionStore;
|
|
use MediaWiki\Block\BlockRestrictionStoreFactory;
|
|
use MediaWiki\DAO\WikiAwareEntity;
|
|
use MediaWikiUnitTestCase;
|
|
use Wikimedia\Rdbms\LBFactory;
|
|
use Wikimedia\Rdbms\LoadBalancer;
|
|
|
|
/**
|
|
* @covers \MediaWiki\Block\BlockRestrictionStoreFactory
|
|
*/
|
|
class BlockRestrictionStoreFactoryTest extends MediaWikiUnitTestCase {
|
|
|
|
/**
|
|
* @dataProvider provideDomains
|
|
*/
|
|
public function testGetBlockRestrictionStore( $domain ) {
|
|
$lb = $this->createMock( LoadBalancer::class );
|
|
$lbFactory = $this->createMock( LBFactory::class );
|
|
$lbFactory
|
|
->method( 'getMainLB' )
|
|
->with( $domain )
|
|
->willReturn( $lb );
|
|
$factory = new BlockRestrictionStoreFactory( $lbFactory );
|
|
|
|
$restrictionStore = $factory->getBlockRestrictionStore( $domain );
|
|
$this->assertInstanceOf( BlockRestrictionStore::class, $restrictionStore );
|
|
}
|
|
|
|
public static function provideDomains() {
|
|
yield 'local wiki' => [ WikiAwareEntity::LOCAL ];
|
|
yield 'foreign wiki' => [ 'meta' ];
|
|
}
|
|
|
|
}
|