/** * group accountconf */ function testPauseAccountAndLoginShouldFail() { $accountController = new AccountController(); $confirm_worked = confirm_player($this->test_ninja_name, false, true); // name, no confirm #, just autoconfirm. $this->assertTrue((bool) $confirm_worked); $char_id = get_char_id($this->test_ninja_name); $paused = $accountController->pauseAccount($char_id); // Fully pause the account, make the operational bit = false $this->assertTrue((bool) $paused); $account_operational = query_item('SELECT operational FROM accounts JOIN account_players ON account_id = _account_id WHERE _player_id = :char_id', [':char_id' => $char_id]); $this->assertFalse($account_operational); $res = login_user($this->test_email, $this->test_password); $this->assertFalse($res['success'], 'Login should not be successful when account is paused'); $this->assertTrue(is_string($res['login_error'])); $this->assertTrue((bool) $res['login_error']); }