From e4f69ee33e11a339a519ed7526242432b838aef3 Mon Sep 17 00:00:00 2001 From: Lucas Werkmeister Date: Fri, 30 Aug 2019 14:31:11 +0200 Subject: [PATCH] Also set $wgContLang in MWITC::setContentLang() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This assignment got lost in change Ie7a89f6ed7 (commit 47464abb4f) – the resetServices() now implicit in setMwGlobals() resets the ContentLanguage service, but does not update the $wgContLang global. setService( 'ContentLanguage' ) does update it, but that method is deliberately not used in this branch of setContentLang(), for reasons that I assume are still relevant even though the comment explaining them was removed – see change I8c60e37c17 (commit c70c2e4714). Bug: T231630 Change-Id: I0170cc6bf40a5524523c45e8ffff8f72adc2fc47 --- tests/phpunit/MediaWikiIntegrationTestCase.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/phpunit/MediaWikiIntegrationTestCase.php b/tests/phpunit/MediaWikiIntegrationTestCase.php index 83f27e847d..b1eb9effa7 100644 --- a/tests/phpunit/MediaWikiIntegrationTestCase.php +++ b/tests/phpunit/MediaWikiIntegrationTestCase.php @@ -1122,7 +1122,10 @@ abstract class MediaWikiIntegrationTestCase extends PHPUnit\Framework\TestCase { $this->setService( 'ContentLanguage', $lang ); $this->setMwGlobals( 'wgLanguageCode', $lang->getCode() ); } else { - $this->setMwGlobals( 'wgLanguageCode', $lang ); + $this->setMwGlobals( [ + 'wgLanguageCode' => $lang, + 'wgContLang' => Language::factory( $lang ), + ] ); } } -- 2.20.1