parserTest: Make $wgResourceBasePath match $wgScriptPath
authorTimo Tijhof <krinklemail@gmail.com>
Tue, 23 Feb 2016 02:13:11 +0000 (02:13 +0000)
committerTimo Tijhof <krinklemail@gmail.com>
Tue, 23 Feb 2016 02:23:05 +0000 (02:23 +0000)
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
tests/parser/parserTests.txt
tests/phpunit/includes/parser/NewParserTest.php

index fa774c7..549a51f 100644 (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',
index 9ad7bd5..3bbc00d 100644 (file)
@@ -9804,8 +9804,7 @@ Magic Word: {{SCRIPTPATH}}
 !! wikitext
 {{SCRIPTPATH}}
 !! html
-<p>/
-</p>
+
 !! end
 
 !! test
index fa86eed..04d6067 100644 (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;