Remove messages.inc, rebuildLanguage.php, writeMessagesArray.inc
[mediawiki.git] / tests / phpunit / includes / api / UserWrapper.php
blobf8da0ff4e3c0ddc78704d64b8f4b9d83344d871b
1 <?php
3 class UserWrapper {
4 public $userName;
5 public $password;
6 public $user;
8 public function __construct( $userName, $password, $group = '' ) {
9 $this->userName = $userName;
10 $this->password = $password;
12 $this->user = User::newFromName( $this->userName );
13 if ( !$this->user->getID() ) {
14 $this->user = User::createNew( $this->userName, array(
15 "email" => "test@example.com",
16 "real_name" => "Test User" ) );
18 $this->user->setPassword( $this->password );
20 if ( $group !== '' ) {
21 $this->user->addGroup( $group );
23 $this->user->saveSettings();