Avoid indirect global access in unit tests

If a ResourceLoaderFileModule is constructed with no arguments, it
accesses global variables, so this is not allowed from a unit test.
(This is probably a bug in ResourceLoaderFileModule, but one thing at a
time.)

This blocks If005958c76bbfabba74def4215c48fe94f297797.

Change-Id: I84056024b0d3a9dcddb1ab4dc8596118bb3fe8ea
This commit is contained in:
Aryeh Gregor 2022-04-27 17:58:48 +03:00
parent 5b4cd3623b
commit 7bd68f0efa

View file

@ -14,7 +14,7 @@ use ResourceLoaderContext;
class CiteDataModuleTest extends \MediaWikiUnitTestCase {
public function testGetScript() {
$module = new CiteVisualEditorModule();
$module = new CiteVisualEditorModule( [], '', '' );
$context = $this->createResourceLoaderContext();
$this->assertSame(
@ -24,7 +24,7 @@ class CiteDataModuleTest extends \MediaWikiUnitTestCase {
}
public function testGetDefinitionSummary() {
$module = new CiteVisualEditorModule();
$module = new CiteVisualEditorModule( [], '', '' );
$context = $this->createResourceLoaderContext();
$summary = $module->getDefinitionSummary( $context );