From: Timo Tijhof Date: Tue, 15 Mar 2016 03:11:55 +0000 (+0000) Subject: resourceloader: Add structure unit test to confirm messages exist X-Git-Tag: 1.31.0-rc.0~6018^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/One?a=commitdiff_plain;h=39a00e2ea0dde5a67b065178295d3f9cc614e2c1;p=lhc%2Fweb%2Fwiklou.git resourceloader: Add structure unit test to confirm messages exist Bug: T129976 Change-Id: I5333523efe3e7b9191e871d67d9eb650002c7784 --- diff --git a/tests/phpunit/structure/ResourcesTest.php b/tests/phpunit/structure/ResourcesTest.php index 6446416109..86ce53f339 100644 --- a/tests/phpunit/structure/ResourcesTest.php +++ b/tests/phpunit/structure/ResourcesTest.php @@ -86,6 +86,25 @@ class ResourcesTest extends MediaWikiTestCase { } } + /** + * Verify that all specified messages actually exist. + */ + public function testMissingMessages() { + $data = self::getAllModules(); + $validDeps = array_keys( $data['modules'] ); + $lang = Language::factory( 'en' ); + + /** @var ResourceLoaderModule $module */ + foreach ( $data['modules'] as $moduleName => $module ) { + foreach ( $module->getMessages() as $msgKey ) { + $this->assertTrue( + wfMessage( $msgKey )->useDatabase( false )->inLanguage( $lang )->exists(), + "Message '$msgKey' required by '$moduleName' must exist" + ); + } + } + } + /** * Verify that all dependencies of all modules are always satisfiable with the 'targets' defined * for the involved modules.