3 use MediaWiki\Tests\Maintenance\MaintenanceBaseTestCase
;
6 * @covers \RebuildMessages
9 class RebuildMessagesTest
extends MaintenanceBaseTestCase
{
10 public function getMaintenanceClass() {
11 return RebuildMessages
::class;
14 public function testExecute() {
15 // Mock the MessageCache to expect that ::clear is called once by the maintenance script
16 $mockMessageCache = $this->createMock( MessageCache
::class );
17 $mockMessageCache->expects( $this->once() )
19 $this->setService( 'MessageCache', $mockMessageCache );
20 $this->maintenance
->execute();
21 $this->expectOutputRegex( '/Purging message cache.*Done/' );