Localisation updates from https://translatewiki.net.
[mediawiki.git] / tests / phpunit / maintenance / PurgeExpiredBlocksTest.php
blob725eb8e5296b4becdf58391919d4379d9da410bf
1 <?php
3 use MediaWiki\Block\DatabaseBlockStore;
4 use MediaWiki\Tests\Maintenance\MaintenanceBaseTestCase;
6 /**
7 * @covers \PurgeExpiredBlocks
8 * @author Dreamy Jazz
9 */
10 class PurgeExpiredBlocksTest extends MaintenanceBaseTestCase {
11 public function getMaintenanceClass() {
12 return PurgeExpiredBlocks::class;
15 public function testExecute() {
16 // Mock the DatabaseBlockStore to expect that ::purgeExpiredBlocks is called once.
17 $mockDatabaseBlockStore = $this->createMock( DatabaseBlockStore::class );
18 $mockDatabaseBlockStore->expects( $this->once() )
19 ->method( 'purgeExpiredBlocks' );
20 $this->setService( 'DatabaseBlockStore', $mockDatabaseBlockStore );
21 $this->maintenance->execute();
22 $this->expectOutputRegex( '/Purging expired blocks/' );