Debian Codegraph @

tests/phpunit/maintenance/language/AllTransTest.php

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