parserTest: Make $wgResourceBasePath match $wgScriptPath

Right now it forgets to reset $wgResourceBasePath, which means it
is inherited from the wikis's (or Jenkins') default settings which
is typically '/w'. That caused parser tests to behave as if pointers
to /extensions were outside /w.

Also update wgScriptPath to be '' instead of '/'. Otherwise this
can cause double-slash prefixed urls.

Change-Id: Ic455d62fca8fcac2c4ecc055cc0d7e311b70a94a
This commit is contained in:
Timo Tijhof 2016-02-23 02:13:11 +00:00
parent 0e19c04838
commit 2eeda9bc7d
3 changed files with 9 additions and 8 deletions

View file

@ -168,15 +168,16 @@ class ParserTest {
$wgUser, $wgLang, $wgOut, $wgRequest, $wgStyleDirectory,
$wgExtraNamespaces, $wgNamespaceAliases, $wgNamespaceProtection, $wgLocalFileRepo,
$wgExtraInterlanguageLinkPrefixes, $wgLocalInterwikis,
$parserMemc, $wgThumbnailScriptPath, $wgScriptPath,
$parserMemc, $wgThumbnailScriptPath, $wgScriptPath, $wgResourceBasePath,
$wgArticlePath, $wgScript, $wgStylePath, $wgExtensionAssetsPath,
$wgMainCacheType, $wgMessageCacheType, $wgParserCacheType, $wgLockManagers;
$wgScriptPath = '';
$wgScript = '/index.php';
$wgScriptPath = '/';
$wgArticlePath = '/wiki/$1';
$wgStylePath = '/skins';
$wgResourceBasePath = '';
$wgExtensionAssetsPath = '/extensions';
$wgArticlePath = '/wiki/$1';
$wgThumbnailScriptPath = false;
$wgLockManagers = [ [
'name' => 'fsLockManager',

View file

@ -9804,8 +9804,7 @@ Magic Word: {{SCRIPTPATH}}
!! wikitext
{{SCRIPTPATH}}
!! html
<p>/
</p>
!! end
!! test

View file

@ -71,13 +71,14 @@ class NewParserTest extends MediaWikiTestCase {
$tmpGlobals['wgSitename'] = 'MediaWiki';
$tmpGlobals['wgServer'] = 'http://example.org';
$tmpGlobals['wgServerName'] = 'example.org';
$tmpGlobals['wgScriptPath'] = '';
$tmpGlobals['wgScript'] = '/index.php';
$tmpGlobals['wgScriptPath'] = '/';
$tmpGlobals['wgResourceBasePath'] = '';
$tmpGlobals['wgStylePath'] = '/skins';
$tmpGlobals['wgExtensionAssetsPath'] = '/extensions';
$tmpGlobals['wgArticlePath'] = '/wiki/$1';
$tmpGlobals['wgActionPaths'] = [];
$tmpGlobals['wgVariantArticlePath'] = false;
$tmpGlobals['wgExtensionAssetsPath'] = '/extensions';
$tmpGlobals['wgStylePath'] = '/skins';
$tmpGlobals['wgEnableUploads'] = true;
$tmpGlobals['wgUploadNavigationUrl'] = false;
$tmpGlobals['wgThumbnailScriptPath'] = false;