From: Timo Tijhof Date: Tue, 23 Feb 2016 02:13:11 +0000 (+0000) Subject: parserTest: Make $wgResourceBasePath match $wgScriptPath X-Git-Tag: 1.31.0-rc.0~7867 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22lang_raccourcis%22%2C%22module=%24nom_module%22%29%20.%20%22?a=commitdiff_plain;h=2eeda9bc7d6f26fc72ca8a2158f87912b1bb5770;p=lhc%2Fweb%2Fwiklou.git 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 --- diff --git a/tests/parser/parserTest.inc b/tests/parser/parserTest.inc index fa774c7b48..549a51f6a5 100644 --- a/tests/parser/parserTest.inc +++ b/tests/parser/parserTest.inc @@ -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', diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index 9ad7bd547a..3bbc00dbb8 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -9804,8 +9804,7 @@ Magic Word: {{SCRIPTPATH}} !! wikitext {{SCRIPTPATH}} !! html -

/ -

+ !! end !! test diff --git a/tests/phpunit/includes/parser/NewParserTest.php b/tests/phpunit/includes/parser/NewParserTest.php index fa86eede6c..04d606782a 100644 --- a/tests/phpunit/includes/parser/NewParserTest.php +++ b/tests/phpunit/includes/parser/NewParserTest.php @@ -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;