Localisation updates from https://translatewiki.net.
[mediawiki.git] / tests / phpunit / maintenance / language / DumpMessagesTest.php
blobf0ca9386c6c81bb87b6009ffb1d8dfc4aa79f921
1 <?php
3 namespace MediaWiki\Tests\Maintenance;
5 use DumpMessages;
6 use MediaWiki\Json\FormatJson;
7 use MediaWiki\Tests\Language\MockLocalisationCacheTrait;
9 /**
10 * @covers \DumpMessages
11 * @author Dreamy Jazz
13 class DumpMessagesTest extends MaintenanceBaseTestCase {
14 use MockLocalisationCacheTrait;
16 protected function getMaintenanceClass() {
17 return DumpMessages::class;
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 ) )
27 $this->maintenance->execute();
30 public static function provideExecute() {
31 return [
32 'Using mock en.json' => [ MW_INSTALL_PATH . "/tests/phpunit/data/localisationcache/en.json" ],