Debian Codegraph @

tests/phpunit/maintenance/RebuildMessagesTest.php

raw symbols SCIP
1 <?php
2
3 use MediaWiki\Tests\Maintenance\MaintenanceBaseTestCase;
4
5 /**
6 * @covers \RebuildMessages
7 * @author Dreamy Jazz
8 */
9 class RebuildMessagesTest extends MaintenanceBaseTestCase {
10 public function getMaintenanceClass() {
11 return RebuildMessages::class;
12 }
13
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/' );
22 }
23 }