Debian Codegraph @

tests/phpunit/maintenance/language/DumpMessagesTest.php

raw symbols SCIP
1 <?php
2
3 namespace MediaWiki\Tests\Maintenance;
4
5 use DumpMessages;
6 use MediaWiki\Json\FormatJson;
7 use MediaWiki\Tests\Language\MockLocalisationCacheTrait;
8
9 /**
10 * @covers DumpMessages
11 * @author Dreamy Jazz
12 */
13 class DumpMessagesTest extends MaintenanceBaseTestCase {
14 use MockLocalisationCacheTrait;
15
16 protected function getMaintenanceClass() {
17 return DumpMessages::class;
18 }
19
20 /** @dataProvider provideExecute */
21 public function testExecute( $enMessageJsonFile ) {
22 $this->setService( 'LocalisationCache', $this->getMockLocalisationCache() );
23 $this->expectOutputString(
24 "MediaWiki " . MW_VERSION . " language file\n" .
25 serialize( FormatJson::decode( file_get_contents( $enMessageJsonFile ), true ) )
26 );
27 $this->maintenance->execute();
28 }
29
30 public static function provideExecute() {
31 return [
32 'Using mock en.json' => [ MW_INSTALL_PATH . "/tests/phpunit/data/localisationcache/en.json" ],
33 ];
34 }
35 }