Esempio n. 1
0
 public function testLoginWithGibberishFails()
 {
     $controller = new LoginController();
     $error_message = $controller->performLogin('gibber', 'ish');
     $this->assertNotEmpty($error_message);
 }
Esempio n. 2
0
 function testPauseAccountAndLoginShouldFail()
 {
     $player = Player::findByName($this->test_ninja_name);
     $player->active = 1;
     $player->save();
     $account = Account::findByChar($player);
     $account->confirmed = 1;
     $account->setOperational(true);
     $account->save();
     $accountController = new AccountController();
     $controller = new LoginController();
     $res = $controller->performLogin($this->test_email, $this->test_password);
     $this->assertEmpty($res, 'Login should be successful when account is new');
     // Fully pause the account, make the operational bit = false
     $player->active = 0;
     $player->save();
     $account->setOperational(false);
     $account->save();
     $res = $controller->performLogin($this->test_email, $this->test_password);
     $this->assertNotEmpty($res, 'Login should not be successful when account is paused');
 }