From 2eeda9bc7d6f26fc72ca8a2158f87912b1bb5770 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Tue, 23 Feb 2016 02:13:11 +0000 Subject: [PATCH] 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 --- tests/parser/parserTest.inc | 7 ++++--- tests/parser/parserTests.txt | 3 +-- tests/phpunit/includes/parser/NewParserTest.php | 7 ++++--- 3 files changed, 9 insertions(+), 8 deletions(-) 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; -- 2.20.1