3 * Ensures that all message keys defined by Codex exist in MediaWiki's i18n files.
7 class CodexMessageDefinitionTest
extends MediaWikiIntegrationTestCase
{
9 public function testThatMessagesExist() {
10 $resourcesPath = __DIR__
. '/../../../resources';
11 $languagesPath = __DIR__
. '/../../../languages';
12 $messageKeys = json_decode( file_get_contents( "$resourcesPath/lib/codex/messageKeys.json" ), true );
13 $qqq = json_decode( file_get_contents( "$languagesPath/i18n/codex/qqq.json" ), true );
14 $en = json_decode( file_get_contents( "$languagesPath/i18n/codex/en.json" ), true );
16 foreach ( $messageKeys as $key ) {
17 $this->assertArrayHasKey( $key, $qqq, "$key must be defined in $languagesPath/i18n/codex/qqq.json" );
20 foreach ( $messageKeys as $key ) {
21 $this->assertArrayHasKey( $key, $en, "$key must be defined in $languagesPath/i18n/codex/en.json" );