JavaScriptContentTest: $wgScript != $wgScriptPath
authorsaper <saper@saper.info>
Mon, 26 Oct 2015 22:05:15 +0000 (23:05 +0100)
committersaper <saper@saper.info>
Mon, 26 Oct 2015 22:05:15 +0000 (23:05 +0100)
Set $wgScript, $wgScriptPath and $wgResourceBasePath
to avoid failures when running on a wiki with
a non-standard $wgScriptPath.

Reported-on:

https://lists.wikimedia.org/pipermail/wikitech-l/2015-October/083675.html

Change-Id: I8acbcca5449060ff5604bf275f690b53343e706e

tests/phpunit/includes/content/JavaScriptContentTest.php

index b97842c..a636e56 100644 (file)
@@ -258,7 +258,9 @@ class JavaScriptContentTest extends TextContentTest {
        public function testUpdateRedirect( $oldText, $expectedText ) {
                $this->setMwGlobals( array(
                        'wgServer' => '//example.org',
-                       'wgScriptPath' => '/w/index.php',
+                       'wgScriptPath' => '/w',
+                       'wgScript' => '/w/index.php',
+                       'wgResourceBasePath' => '/w',
                ) );
                $target = Title::newFromText( "testUpdateRedirect_target" );
 
@@ -317,7 +319,9 @@ class JavaScriptContentTest extends TextContentTest {
        public function testGetRedirectTarget( $title, $text ) {
                $this->setMwGlobals( array(
                        'wgServer' => '//example.org',
-                       'wgScriptPath' => '/w/index.php',
+                       'wgScriptPath' => '/w',
+                       'wgScript' => '/w/index.php',
+                       'wgResourceBasePath' => '/w',
                ) );
                $content = new JavaScriptContent( $text );
                $target = $content->getRedirectTarget();