From: Brad Jorsch Date: Mon, 3 Apr 2017 13:41:21 +0000 (-0400) Subject: Fix ApiMainTest::testApiErrorFormatterCreation X-Git-Tag: 1.31.0-rc.0~3625 X-Git-Url: http://git.cyclocoop.org/%22.%20generer_url_ecrire%28%22sites_tous%22%2C%22%22%29.%20%22?a=commitdiff_plain;h=ca61e20e3d14e6a807c13ce58897f9b9bd63b5da;p=lhc%2Fweb%2Fwiklou.git 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 --- 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, ]