Fix ApiMainTest::testApiErrorFormatterCreation
authorBrad Jorsch <bjorsch@wikimedia.org>
Mon, 3 Apr 2017 13:41:21 +0000 (09:41 -0400)
committerBrad Jorsch <bjorsch@wikimedia.org>
Mon, 3 Apr 2017 13:44:13 +0000 (09:44 -0400)
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

index 5c0a5d9..922f7f1 100644 (file)
@@ -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,
                                ]