jenkins-bot has submitted this change and it was merged.

Change subject: parserTest: Make $wgResourceBasePath match $wgScriptPath
......................................................................


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
---
M tests/parser/parserTest.inc
M tests/parser/parserTests.txt
M tests/phpunit/includes/parser/NewParserTest.php
3 files changed, 9 insertions(+), 8 deletions(-)

Approvals:
  Tim Starling: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/tests/parser/parserTest.inc b/tests/parser/parserTest.inc
index fa774c7..549a51f 100644
--- a/tests/parser/parserTest.inc
+++ b/tests/parser/parserTest.inc
@@ -168,15 +168,16 @@
                        $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 9ad7bd5..3bbc00d 100644
--- a/tests/parser/parserTests.txt
+++ b/tests/parser/parserTests.txt
@@ -9804,8 +9804,7 @@
 !! wikitext
 {{SCRIPTPATH}}
 !! html
-<p>/
-</p>
+
 !! end
 
 !! test
diff --git a/tests/phpunit/includes/parser/NewParserTest.php 
b/tests/phpunit/includes/parser/NewParserTest.php
index fa86eed..04d6067 100644
--- a/tests/phpunit/includes/parser/NewParserTest.php
+++ b/tests/phpunit/includes/parser/NewParserTest.php
@@ -71,13 +71,14 @@
                $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;

-- 
To view, visit https://gerrit.wikimedia.org/r/272659
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic455d62fca8fcac2c4ecc055cc0d7e311b70a94a
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Krinkle <krinklem...@gmail.com>
Gerrit-Reviewer: Cscott <canan...@wikimedia.org>
Gerrit-Reviewer: Jackmcbarn <jackmcb...@gmail.com>
Gerrit-Reviewer: MaxSem <maxsem.w...@gmail.com>
Gerrit-Reviewer: Tim Starling <tstarl...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to