From ca61e20e3d14e6a807c13ce58897f9b9bd63b5da Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Mon, 3 Apr 2017 09:41:21 -0400 Subject: [PATCH] Fix ApiMainTest::testApiErrorFormatterCreation API tests are all subclasses of MediaWikiLangTestCase, which overrides the content language when the tests are actually running. So we need to always use 'en' to match that. Bug: T162007 Change-Id: Ie001576fb62ae88c9141e471fd8fcbc49592be32 --- tests/phpunit/includes/api/ApiMainTest.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/phpunit/includes/api/ApiMainTest.php b/tests/phpunit/includes/api/ApiMainTest.php index 5c0a5d98a4..922f7f147c 100644 --- a/tests/phpunit/includes/api/ApiMainTest.php +++ b/tests/phpunit/includes/api/ApiMainTest.php @@ -331,8 +331,6 @@ class ApiMainTest extends ApiTestCase { } public static function provideApiErrorFormatterCreation() { - global $wgContLang; - return [ 'Default (BC)' => [ [], [ 'uselang' => 'ru', @@ -382,9 +380,9 @@ class ApiMainTest extends ApiTestCase { 'uselang=content' => [ [ 'uselang' => 'content', 'errorformat' => 'plaintext' ], [ - 'uselang' => $wgContLang->getCode(), + 'uselang' => 'en', 'class' => ApiErrorFormatter::class, - 'lang' => $wgContLang->getCode(), + 'lang' => 'en', 'format' => 'plaintext', 'usedb' => false, ] @@ -394,7 +392,7 @@ class ApiMainTest extends ApiTestCase { [ 'uselang' => 'ru', 'class' => ApiErrorFormatter::class, - 'lang' => $wgContLang->getCode(), + 'lang' => 'en', 'format' => 'plaintext', 'usedb' => false, ] -- 2.20.1