Make use of MainConfigNames constants in tests

Change-Id: I55aa25268b9d2f48f90b6f79ed4309c9b2355bd9
This commit is contained in:
thiemowmde 2024-08-26 16:57:38 +02:00 committed by jenkins-bot
parent 5ced07c366
commit 40ebea2313
2 changed files with 23 additions and 22 deletions

View file

@ -3,6 +3,7 @@
namespace MediaWiki\Extension\Scribunto\Tests\Engines\LuaCommon; namespace MediaWiki\Extension\Scribunto\Tests\Engines\LuaCommon;
use MediaWiki\Interwiki\ClassicInterwikiLookup; use MediaWiki\Interwiki\ClassicInterwikiLookup;
use MediaWiki\MainConfigNames;
use MediaWiki\Page\PageIdentityValue; use MediaWiki\Page\PageIdentityValue;
use MediaWiki\Parser\ParserOutputFlags; use MediaWiki\Parser\ParserOutputFlags;
use MediaWiki\Permissions\RestrictionStore; use MediaWiki\Permissions\RestrictionStore;
@ -29,20 +30,18 @@ class TitleLibraryTest extends LuaEngineTestBase {
// Set up interwikis (via wgInterwikiCache) before creating any Titles // Set up interwikis (via wgInterwikiCache) before creating any Titles
$this->overrideConfigValues( [ $this->overrideConfigValues( [
'Server' => '//wiki.local', MainConfigNames::Server => '//wiki.local',
'CanonicalServer' => 'http://wiki.local', MainConfigNames::CanonicalServer => 'http://wiki.local',
'UsePathInfo' => true, MainConfigNames::UsePathInfo => true,
'ActionPaths' => [], MainConfigNames::ActionPaths => [],
'Script' => '/w/index.php', MainConfigNames::Script => '/w/index.php',
'ScriptPath' => '/w', MainConfigNames::ScriptPath => '/w',
'ArticlePath' => '/wiki/$1', MainConfigNames::ArticlePath => '/wiki/$1',
'InterwikiCache' => ClassicInterwikiLookup::buildCdbHash( [ MainConfigNames::InterwikiCache => ClassicInterwikiLookup::buildCdbHash( [ [
[ 'iw_prefix' => 'interwikiprefix',
'iw_prefix' => 'interwikiprefix', 'iw_url' => '//test.wikipedia.org/wiki/$1',
'iw_url' => '//test.wikipedia.org/wiki/$1', 'iw_local' => 0,
'iw_local' => 0, ] ] ),
],
] ),
] ); ] );
$editor = self::getTestSysop()->getUser(); $editor = self::getTestSysop()->getUser();

View file

@ -2,6 +2,8 @@
namespace MediaWiki\Extension\Scribunto\Tests\Engines\LuaCommon; namespace MediaWiki\Extension\Scribunto\Tests\Engines\LuaCommon;
use MediaWiki\MainConfigNames;
/** /**
* @covers \MediaWiki\Extension\Scribunto\Engines\LuaCommon\UriLibrary * @covers \MediaWiki\Extension\Scribunto\Engines\LuaCommon\UriLibrary
*/ */
@ -13,14 +15,14 @@ class UriLibraryTest extends LuaEngineTestBase {
parent::setUp(); parent::setUp();
$this->overrideConfigValues( [ $this->overrideConfigValues( [
'Server' => '//wiki.local', MainConfigNames::Server => '//wiki.local',
'CanonicalServer' => 'http://wiki.local', MainConfigNames::CanonicalServer => 'http://wiki.local',
'UsePathInfo' => true, MainConfigNames::UsePathInfo => true,
'ActionPaths' => [], MainConfigNames::ActionPaths => [],
'Script' => '/w/index.php', MainConfigNames::Script => '/w/index.php',
'ScriptPath' => '/w', MainConfigNames::ScriptPath => '/w',
'ArticlePath' => '/wiki/$1', MainConfigNames::ArticlePath => '/wiki/$1',
'FragmentMode' => [ 'legacy', 'html5' ], MainConfigNames::FragmentMode => [ 'legacy', 'html5' ],
] ); ] );
} }