From 392d7af74afa0dd29c17a7046ed65eabe63a105f Mon Sep 17 00:00:00 2001 From: "Mark A. Hershberger" Date: Tue, 23 Feb 2010 05:14:42 +0000 Subject: [PATCH] Use globals correctly to make tests work again. --- maintenance/tests/ApiTest.php | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) 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 '. -- 2.20.1