3 use MediaWiki\ResourceLoader\MessageBlobStore
;
4 use MediaWiki\ResourceLoader\ResourceLoader
;
5 use MediaWiki\Tests\Maintenance\MaintenanceBaseTestCase
;
8 * @covers \PurgeMessageBlobStore
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() )
22 $resourceLoader = $this->createMock( ResourceLoader
::class );
23 $resourceLoader->method( 'getMessageBlobStore' )
24 ->willReturn( $mockMessageBlobStore );
25 $this->setService( 'ResourceLoader', $resourceLoader );
26 $this->maintenance
->execute();