Localisation updates from https://translatewiki.net.
[mediawiki.git] / tests / phpunit / maintenance / RebuildMessagesTest.php
blob88e49828eeb81a6e94830fb1a2e3404a35537478
1 <?php
3 use MediaWiki\Tests\Maintenance\MaintenanceBaseTestCase;
5 /**
6 * @covers \RebuildMessages
7 * @author Dreamy Jazz
8 */
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() )
18 ->method( 'clear' );
19 $this->setService( 'MessageCache', $mockMessageCache );
20 $this->maintenance->execute();
21 $this->expectOutputRegex( '/Purging message cache.*Done/' );