r62865 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62864‎ | r62865 | r62866 >
Date:05:14, 23 February 2010
Author:mah
Status:ok
Tags:
Comment:
Use globals correctly to make tests work again.
Modified paths:
  • /trunk/phase3/maintenance/tests/ApiTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/tests/ApiTest.php
@@ -57,7 +57,9 @@
5858 }
5959
6060 function testApi() {
61 - if(!isset($wgServername) || !isset($wgServer)) {
 61+ global $wgServerName, $wgServer;
 62+
 63+ if(!isset($wgServerName) || !isset($wgServer)) {
6264 $this->markTestIncomplete('This test needs $wgServerName and $wgServer to '.
6365 'be set in LocalSettings.php');
6466 }
@@ -71,7 +73,9 @@
7274 }
7375
7476 function testApiLoginNoName() {
75 - if(!isset($wgServername) || !isset($wgServer)) {
 77+ global $wgServerName, $wgServer;
 78+
 79+ if(!isset($wgServerName) || !isset($wgServer)) {
7680 $this->markTestIncomplete('This test needs $wgServerName and $wgServer to '.
7781 'be set in LocalSettings.php');
7882 }
@@ -88,7 +92,9 @@
8993 }
9094
9195 function testApiLoginBadPass() {
92 - if(!isset($wgServername) || !isset($wgServer)) {
 96+ global $wgServerName, $wgServer;
 97+
 98+ if(!isset($wgServerName) || !isset($wgServer)) {
9399 $this->markTestIncomplete('This test needs $wgServerName and $wgServer to '.
94100 'be set in LocalSettings.php');
95101 }
@@ -105,7 +111,9 @@
106112 }
107113
108114 function testApiLoginGoodPass() {
109 - if(!isset($wgServername) || !isset($wgServer)) {
 115+ global $wgServerName, $wgServer;
 116+
 117+ if(!isset($wgServerName) || !isset($wgServer)) {
110118 $this->markTestIncomplete('This test needs $wgServerName and $wgServer to '.
111119 'be set in LocalSettings.php');
112120 }
@@ -122,9 +130,9 @@
123131 }
124132
125133 function testApiGotCookie() {
126 - global $wgScriptPath, $wgServerName;
 134+ global $wgServerName, $wgServer, $wgScriptPath;
127135
128 - if(!isset($wgServername) || !isset($wgServer)) {
 136+ if(!isset($wgServerName) || !isset($wgServer)) {
129137 $this->markTestIncomplete('This test needs $wgServerName and $wgServer to '.
130138 'be set in LocalSettings.php');
131139 }
@@ -146,6 +154,7 @@
147155 */
148156 function testApiListPages(CookieJar $cj) {
149157 $this->markTestIncomplete("Not done with this yet");
 158+ global $wgServerName, $wgServer;
150159
151160 if($wgServerName == "localhost" || $wgServer == "http://localhost") {
152161 $this->markTestIncomplete('This test needs $wgServerName and $wgServer to '.

Status & tagging log