r74218 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r74217‎ | r74218 | r74219 >
Date:15:58, 3 October 2010
Author:reedy
Status:ok
Tags:
Comment:
Variable UserWrapper used in both testApiLoginBadPass and testApiLoginGoodPass

Switch testApiLoginGoodPass to use sysOp user, as I imagine, logins would be a false positive, per Brion r74122#c9828
Modified paths:
  • /trunk/phase3/maintenance/tests/phpunit/includes/api/ApiTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/tests/phpunit/includes/api/ApiTest.php
@@ -87,12 +87,14 @@
8888 function testApiLoginBadPass() {
8989 global $wgServer;
9090
 91+ $user = self::$sysopUser;
 92+
9193 if ( !isset( $wgServer ) ) {
9294 $this->markTestIncomplete( 'This test needs $wgServer to be set in LocalSettings.php' );
9395 }
9496 $ret = $this->doApiRequest( array(
9597 "action" => "login",
96 - "lgname" => self::$sysopUser->userName,
 98+ "lgname" => $user->userName,
9799 "lgpassword" => "bad",
98100 )
99101 );
@@ -108,7 +110,7 @@
109111 $ret = $this->doApiRequest( array(
110112 "action" => "login",
111113 "lgtoken" => $token,
112 - "lgname" => self::$sysopUser->userName,
 114+ "lgname" => $user->userName,
113115 "lgpassword" => "bad",
114116 )
115117 );
@@ -128,10 +130,12 @@
129131 $this->markTestIncomplete( 'This test needs $wgServer to be set in LocalSettings.php' );
130132 }
131133
 134+ $user = self::$sysopUser;
 135+
132136 $ret = $this->doApiRequest( array(
133137 "action" => "login",
134 - "lgname" => self::$user->userName,
135 - "lgpassword" => self::$user->password,
 138+ "lgname" => $user->userName,
 139+ "lgpassword" => $user->password,
136140 )
137141 );
138142
@@ -146,8 +150,8 @@
147151 $ret = $this->doApiRequest( array(
148152 "action" => "login",
149153 "lgtoken" => $token,
150 - "lgname" => self::$user->userName,
151 - "lgpassword" => self::$user->password,
 154+ "lgname" => $user->userName,
 155+ "lgpassword" => $user->password,
152156 )
153157 );
154158

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r74122Revert r74117. Breaks the test. Using an internal request it doesn't fail wit...platonides23:11, 1 October 2010

Status & tagging log