MediaWiki  1.28.0
TestUser Class Reference

Wraps the user object, so we can also retain full access to properties like password if we log in via the API. More...

Collaboration diagram for TestUser:

Public Member Functions

 __construct ($username, $realname= 'Real Name', $email= 'sample @example.com', $groups=[])
 
 getPassword ()
 
 getUser ()
 

Static Public Member Functions

static setPasswordForUser (User $user, $password)
 Set the password on a testing user. More...
 

Private Member Functions

 assertNotReal ()
 
 setEmail ($email)
 
 setPassword ($password)
 
 setRealName ($realname)
 

Private Attributes

string $password
 
User $user
 
string $username
 

Detailed Description

Wraps the user object, so we can also retain full access to properties like password if we log in via the API.

Definition at line 7 of file TestUser.php.

Constructor & Destructor Documentation

TestUser::__construct (   $username,
  $realname = 'Real Name',
  $email = 'sample@example.com',
  $groups = [] 
)

Member Function Documentation

TestUser::assertNotReal ( )
private

Definition at line 23 of file TestUser.php.

References $wgDBprefix, MediaWikiTestCase\DB_PREFIX, global, and MediaWikiTestCase\ORA_DB_PREFIX.

Referenced by __construct().

TestUser::getPassword ( )
Since
1.25
Returns
string

Definition at line 168 of file TestUser.php.

References $password.

TestUser::getUser ( )
Since
1.25
Returns
User

Definition at line 160 of file TestUser.php.

References $user.

Referenced by ApiTestCase\getTokenList(), and ApiTokensTest\runTokenTest().

TestUser::setEmail (   $email)
private
Parameters
string$email
Returns
bool

Definition at line 102 of file TestUser.php.

References user.

Referenced by __construct().

TestUser::setPassword (   $password)
private
Parameters
string$password

Definition at line 114 of file TestUser.php.

References user.

Referenced by __construct().

static TestUser::setPasswordForUser ( User  $user,
  $password 
)
static
TestUser::setRealName (   $realname)
private
Parameters
string$realname
Returns
bool

Definition at line 89 of file TestUser.php.

References user.

Referenced by __construct().

Member Data Documentation

string TestUser::$password
private

Definition at line 16 of file TestUser.php.

Referenced by getPassword().

User TestUser::$user
private

Definition at line 21 of file TestUser.php.

Referenced by getUser().

string TestUser::$username
private

Definition at line 11 of file TestUser.php.

Referenced by __construct().


The documentation for this class was generated from the following file: