Merge "Add checkDependencies.php"
[lhc/web/wiklou.git] / tests / phpunit / includes / api / ApiParseTest.php
index b20d43e..9c5268c 100644 (file)
@@ -121,6 +121,7 @@ class ApiParseTest extends ApiTestCase {
 
                $this->setMwGlobals( 'wgExtraInterlanguageLinkPrefixes', [ 'madeuplanguage' ] );
                $this->tablesUsed[] = 'interwiki';
+               $this->overrideMwServices();
        }
 
        /**
@@ -205,6 +206,7 @@ class ApiParseTest extends ApiTestCase {
 
        public function testSuppressed() {
                $this->setGroupPermissions( 'sysop', 'viewsuppressed', true );
+               $this->overrideMwServices();
 
                $res = $this->doApiRequest( [
                        'action' => 'parse',
@@ -581,8 +583,6 @@ class ApiParseTest extends ApiTestCase {
         * @param array $arr Extra params to add to API request
         */
        private function doTestLangLinks( array $arr = [] ) {
-               $this->setupInterwiki();
-
                $res = $this->doApiRequest( array_merge( [
                        'action' => 'parse',
                        'title' => 'Omelette',
@@ -600,10 +600,12 @@ class ApiParseTest extends ApiTestCase {
        }
 
        public function testLangLinks() {
+               $this->setupInterwiki();
                $this->doTestLangLinks();
        }
 
        public function testLangLinksWithSkin() {
+               $this->setupInterwiki();
                $this->setupSkin();
                $this->doTestLangLinks( [ 'useskin' => 'testing' ] );
        }
@@ -650,7 +652,6 @@ class ApiParseTest extends ApiTestCase {
                        function ( $parser ) {
                                $output = $parser->getOutput();
                                $output->addModules( [ 'foo', 'bar' ] );
-                               $output->addModuleScripts( [ 'baz', 'quuz' ] );
                                $output->addModuleStyles( [ 'aaa', 'zzz' ] );
                                $output->addJsConfigVars( [ 'x' => 'y', 'z' => -3 ] );
                        }
@@ -663,7 +664,7 @@ class ApiParseTest extends ApiTestCase {
                ] );
 
                $this->assertSame( [ 'foo', 'bar' ], $res[0]['parse']['modules'] );
-               $this->assertSame( [ 'baz', 'quuz' ], $res[0]['parse']['modulescripts'] );
+               $this->assertSame( [], $res[0]['parse']['modulescripts'] );
                $this->assertSame( [ 'aaa', 'zzz' ], $res[0]['parse']['modulestyles'] );
                $this->assertSame( [ 'x' => 'y', 'z' => -3 ], $res[0]['parse']['jsconfigvars'] );
                $this->assertSame( '{"x":"y","z":-3}', $res[0]['parse']['encodedjsconfigvars'] );