From: saper Date: Mon, 26 Oct 2015 22:05:15 +0000 (+0100) Subject: JavaScriptContentTest: $wgScript != $wgScriptPath X-Git-Tag: 1.31.0-rc.0~9229 X-Git-Url: http://git.cyclocoop.org/%24self?a=commitdiff_plain;h=8fa1555c7886ef3491a23df22eee98eeb8a97c8e;p=lhc%2Fweb%2Fwiklou.git JavaScriptContentTest: $wgScript != $wgScriptPath 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 --- diff --git a/tests/phpunit/includes/content/JavaScriptContentTest.php b/tests/phpunit/includes/content/JavaScriptContentTest.php index b97842c43c..a636e564b4 100644 --- a/tests/phpunit/includes/content/JavaScriptContentTest.php +++ b/tests/phpunit/includes/content/JavaScriptContentTest.php @@ -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();