mirror of
https://github.com/moodle/moodle.git
synced 2025-08-07 18:06:51 +02:00
MDL-42224 fix log output regression in auth test
This commit is contained in:
parent
fc69508f01
commit
80dc19699c
1 changed files with 10 additions and 0 deletions
|
@ -36,6 +36,9 @@ class core_authlib_testcase extends advanced_testcase {
|
||||||
|
|
||||||
$this->resetAfterTest();
|
$this->resetAfterTest();
|
||||||
|
|
||||||
|
$oldlog = ini_get('error_log');
|
||||||
|
ini_set('error_log', "$CFG->dataroot/testlog.log"); // Prevent standard logging.
|
||||||
|
|
||||||
unset_config('noemailever');
|
unset_config('noemailever');
|
||||||
|
|
||||||
set_config('lockoutthreshold', 0);
|
set_config('lockoutthreshold', 0);
|
||||||
|
@ -107,6 +110,8 @@ class core_authlib_testcase extends advanced_testcase {
|
||||||
login_attempt_failed($user);
|
login_attempt_failed($user);
|
||||||
login_attempt_failed($user);
|
login_attempt_failed($user);
|
||||||
$this->assertFalse(login_is_lockedout($user));
|
$this->assertFalse(login_is_lockedout($user));
|
||||||
|
|
||||||
|
ini_set('error_log', $oldlog);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_authenticate_user_login() {
|
public function test_authenticate_user_login() {
|
||||||
|
@ -114,6 +119,9 @@ class core_authlib_testcase extends advanced_testcase {
|
||||||
|
|
||||||
$this->resetAfterTest();
|
$this->resetAfterTest();
|
||||||
|
|
||||||
|
$oldlog = ini_get('error_log');
|
||||||
|
ini_set('error_log', "$CFG->dataroot/testlog.log"); // Prevent standard logging.
|
||||||
|
|
||||||
unset_config('noemailever');
|
unset_config('noemailever');
|
||||||
|
|
||||||
set_config('lockoutthreshold', 0);
|
set_config('lockoutthreshold', 0);
|
||||||
|
@ -178,6 +186,8 @@ class core_authlib_testcase extends advanced_testcase {
|
||||||
$result = authenticate_user_login('username1', 'password1', true, $reason);
|
$result = authenticate_user_login('username1', 'password1', true, $reason);
|
||||||
$this->assertInstanceOf('stdClass', $result);
|
$this->assertInstanceOf('stdClass', $result);
|
||||||
$this->assertEquals(AUTH_LOGIN_OK, $reason);
|
$this->assertEquals(AUTH_LOGIN_OK, $reason);
|
||||||
|
|
||||||
|
ini_set('error_log', $oldlog);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_user_loggedin_event_exceptions() {
|
public function test_user_loggedin_event_exceptions() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue