From: umherirrender Date: Tue, 30 Jul 2013 13:12:12 +0000 (+0200) Subject: Fix parserTests.php for non-english test wikis X-Git-Tag: 1.31.0-rc.0~19081^2 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/cotisations/rappels.php?a=commitdiff_plain;h=890e54c194f55c9c3e87819a2fa5433bf6e68b53;p=lhc%2Fweb%2Fwiklou.git Fix parserTests.php for non-english test wikis Running parserTests.php gives two failed test under a non-english wiki. Both tests have corresponding article parts, which creates system messages for the test. While the messages gets added to the database, the language is not set to en, so the created message gets under the wrong language into the language cache. When running the test, the language is set to en, but the message cannot be found in the language cache. The message is not found. Running test Bug 31098 Template which includes system messages which includes the template... FAILED! Running test Bug 32057: Title needed when expanding nodes.... FAILED! Change-Id: I18fb139e2227343018cdef737bda5aadb5c9fb35 --- diff --git a/tests/parser/parserTest.inc b/tests/parser/parserTest.inc index 0469138ec8..b501296014 100644 --- a/tests/parser/parserTest.inc +++ b/tests/parser/parserTest.inc @@ -434,7 +434,12 @@ class ParserTest { */ public function runTestsFromFiles( $filenames ) { $ok = false; + + // be sure, ParserTest::addArticle has correct language set, + // so that system messages gets into the right language cache + $GLOBALS['wgLanguageCode'] = 'en'; $GLOBALS['wgContLang'] = Language::factory( 'en' ); + $this->recorder->start(); try { $this->setupDatabase();