aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUmherirrender <umherirrender_de.wp@web.de>2022-07-12 19:42:27 +0200
committerUmherirrender <umherirrender_de.wp@web.de>2022-07-13 00:59:46 +0200
commit246bc931f6c1197de0f0e95fac550b94ad26bf2e (patch)
tree3472d7ad0596551862b3b65c57c8d356d42256e6
parenta3a2ed268a39f6e6b257b7d682f921a46b6b6634 (diff)
downloadmediawikicore-246bc931f6c1197de0f0e95fac550b94ad26bf2e.tar.gz
mediawikicore-246bc931f6c1197de0f0e95fac550b94ad26bf2e.zip
tests: Set wgLang with MediaWikiIntegrationTestCase::setUserLang
Change-Id: Ic1247a6719032b3a0ea1f76514edc5ffd5a7854a
-rw-r--r--tests/phpunit/includes/XmlTest.php2
-rw-r--r--tests/phpunit/includes/exception/MWExceptionTest.php7
-rw-r--r--tests/phpunit/includes/parser/ParserOptionsTest.php4
3 files changed, 8 insertions, 5 deletions
diff --git a/tests/phpunit/includes/XmlTest.php b/tests/phpunit/includes/XmlTest.php
index 314f0b3519cd..7fcf8c344966 100644
--- a/tests/phpunit/includes/XmlTest.php
+++ b/tests/phpunit/includes/XmlTest.php
@@ -32,7 +32,7 @@ class XmlTest extends MediaWikiIntegrationTestCase {
101 => 'Custom_talk',
] );
- $this->setMwGlobals( 'wgLang', $langObj );
+ $this->setUserLang( $langObj );
$this->overrideConfigValue( MainConfigNames::UseMediaWikiUIEverywhere, false );
}
diff --git a/tests/phpunit/includes/exception/MWExceptionTest.php b/tests/phpunit/includes/exception/MWExceptionTest.php
index d09009bbe311..481622cdf82d 100644
--- a/tests/phpunit/includes/exception/MWExceptionTest.php
+++ b/tests/phpunit/includes/exception/MWExceptionTest.php
@@ -24,8 +24,13 @@ class MWExceptionTest extends MediaWikiIntegrationTestCase {
* @covers MWException::useOutputPage
*/
public function testUseOutputPage( $expected, $langObj, $fullyInitialised, $outputPage ) {
+ if ( $langObj !== null ) {
+ $this->setUserLang( $langObj );
+ } else {
+ // Reset the global to unset
+ $this->setMwGlobals( 'wgLang', $langObj );
+ }
$this->setMwGlobals( [
- 'wgLang' => $langObj,
'wgFullyInitialised' => $fullyInitialised,
'wgOut' => $outputPage,
] );
diff --git a/tests/phpunit/includes/parser/ParserOptionsTest.php b/tests/phpunit/includes/parser/ParserOptionsTest.php
index ec4278d07f1b..67d6a70effe3 100644
--- a/tests/phpunit/includes/parser/ParserOptionsTest.php
+++ b/tests/phpunit/includes/parser/ParserOptionsTest.php
@@ -32,9 +32,7 @@ class ParserOptionsTest extends MediaWikiLangTestCase {
$contLang = $this->getServiceContainer()->getLanguageFactory()->getLanguage( 'qqx' );
$this->setContentLang( $contLang );
- $this->setMwGlobals( [
- 'wgLang' => $userLang,
- ] );
+ $this->setUserLang( $userLang );
$lang = $this->getServiceContainer()->getLanguageFactory()->getLanguage( 'de' );
$lang2 = $this->getServiceContainer()->getLanguageFactory()->getLanguage( 'bug' );