Localisation updates from https://translatewiki.net.
[mediawiki.git] / tests / phpunit / maintenance / PurgeMessageBlobStoreTest.php
blobfc21d8af905e7970e101195523795d3171d7abf2
1 <?php
3 use MediaWiki\ResourceLoader\MessageBlobStore;
4 use MediaWiki\ResourceLoader\ResourceLoader;
5 use MediaWiki\Tests\Maintenance\MaintenanceBaseTestCase;
7 /**
8 * @covers \PurgeMessageBlobStore
9 * @author Dreamy Jazz
11 class PurgeMessageBlobStoreTest extends MaintenanceBaseTestCase {
12 public function getMaintenanceClass() {
13 return PurgeMessageBlobStore::class;
16 public function testExecute() {
17 // Mock MessageBlobStore::clear, expecting that it be called once.
18 // Testing that calling the method actually clears the cache is done by MessageBlobStoreTest.
19 $mockMessageBlobStore = $this->createMock( MessageBlobStore::class );
20 $mockMessageBlobStore->expects( $this->once() )
21 ->method( 'clear' );
22 $resourceLoader = $this->createMock( ResourceLoader::class );
23 $resourceLoader->method( 'getMessageBlobStore' )
24 ->willReturn( $mockMessageBlobStore );
25 $this->setService( 'ResourceLoader', $resourceLoader );
26 $this->maintenance->execute();