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

View file

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