From: Mark A. Hershberger Date: Tue, 23 Feb 2010 05:14:42 +0000 (+0000) Subject: Use globals correctly to make tests work again. X-Git-Tag: 1.31.0-rc.0~37641 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=392d7af74afa0dd29c17a7046ed65eabe63a105f;p=lhc%2Fweb%2Fwiklou.git Use globals correctly to make tests work again. --- diff --git a/maintenance/tests/ApiTest.php b/maintenance/tests/ApiTest.php index d098b1a2a9..dcdb8db66a 100644 --- a/maintenance/tests/ApiTest.php +++ b/maintenance/tests/ApiTest.php @@ -57,7 +57,9 @@ class ApiTest extends ApiSetup { } function testApi() { - if(!isset($wgServername) || !isset($wgServer)) { + global $wgServerName, $wgServer; + + if(!isset($wgServerName) || !isset($wgServer)) { $this->markTestIncomplete('This test needs $wgServerName and $wgServer to '. 'be set in LocalSettings.php'); } @@ -71,7 +73,9 @@ class ApiTest extends ApiSetup { } function testApiLoginNoName() { - if(!isset($wgServername) || !isset($wgServer)) { + global $wgServerName, $wgServer; + + if(!isset($wgServerName) || !isset($wgServer)) { $this->markTestIncomplete('This test needs $wgServerName and $wgServer to '. 'be set in LocalSettings.php'); } @@ -88,7 +92,9 @@ class ApiTest extends ApiSetup { } function testApiLoginBadPass() { - if(!isset($wgServername) || !isset($wgServer)) { + global $wgServerName, $wgServer; + + if(!isset($wgServerName) || !isset($wgServer)) { $this->markTestIncomplete('This test needs $wgServerName and $wgServer to '. 'be set in LocalSettings.php'); } @@ -105,7 +111,9 @@ class ApiTest extends ApiSetup { } function testApiLoginGoodPass() { - if(!isset($wgServername) || !isset($wgServer)) { + global $wgServerName, $wgServer; + + if(!isset($wgServerName) || !isset($wgServer)) { $this->markTestIncomplete('This test needs $wgServerName and $wgServer to '. 'be set in LocalSettings.php'); } @@ -122,9 +130,9 @@ class ApiTest extends ApiSetup { } function testApiGotCookie() { - global $wgScriptPath, $wgServerName; + global $wgServerName, $wgServer, $wgScriptPath; - if(!isset($wgServername) || !isset($wgServer)) { + if(!isset($wgServerName) || !isset($wgServer)) { $this->markTestIncomplete('This test needs $wgServerName and $wgServer to '. 'be set in LocalSettings.php'); } @@ -146,6 +154,7 @@ class ApiTest extends ApiSetup { */ function testApiListPages(CookieJar $cj) { $this->markTestIncomplete("Not done with this yet"); + global $wgServerName, $wgServer; if($wgServerName == "localhost" || $wgServer == "http://localhost") { $this->markTestIncomplete('This test needs $wgServerName and $wgServer to '.