Use setContentLang instead of setMwGlobals

This sets $wgLanguageCode appropriately.  It will also be necessary when
$wgContLang becomes a service, in which case setting the global directly
will not work correctly.

Bug: T200246
Change-Id: I4aaf1c641ec6abef214eb96c0e4b42a67488ac00
This commit is contained in:
Aryeh Gregor 2018-07-25 19:12:09 +03:00
parent 6e0339b7e0
commit 83be57fe01

View file

@ -949,11 +949,10 @@ TEXT
private function setupTestRevisionsForEventGeneration( $newId, $oldId, $username, $lang, $pages,
$title, $summary = ''
) {
$langObj = Language::factory( $lang );
// Content language is used by the code that interprets the namespace part of titles
// (Title::getTitleParser), so should be the fake language ;)
$this->setContentLang( $lang );
$this->setMwGlobals( [
// this global is used by the code that interprets the namespace part of
// titles (Title::getTitleParser), so should be the fake language ;)
'wgContLang' => $langObj,
// this one allows Mediawiki:xyz pages to be set as messages
'wgUseDatabaseMessages' => true
] );