Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 11
Línea 24... Línea 24...
24
 * @category   test
24
 * @category   test
25
 * @copyright  2012 Petr Skoda {@link http://skodak.org}
25
 * @copyright  2012 Petr Skoda {@link http://skodak.org}
26
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
26
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
27
 */
27
 */
28
class authlib_test extends \advanced_testcase {
28
class authlib_test extends \advanced_testcase {
29
    public function test_lockout() {
29
    public function test_lockout(): void {
30
        global $CFG;
30
        global $CFG;
31
        require_once("$CFG->libdir/authlib.php");
31
        require_once("$CFG->libdir/authlib.php");
Línea 32... Línea 32...
32
 
32
 
Línea 108... Línea 108...
108
        $this->assertFalse(login_is_lockedout($user));
108
        $this->assertFalse(login_is_lockedout($user));
Línea 109... Línea 109...
109
 
109
 
110
        ini_set('error_log', $oldlog);
110
        ini_set('error_log', $oldlog);
Línea 111... Línea 111...
111
    }
111
    }
112
 
112
 
Línea 113... Línea 113...
113
    public function test_authenticate_user_login() {
113
    public function test_authenticate_user_login(): void {
Línea 114... Línea 114...
114
        global $CFG;
114
        global $CFG;
Línea 434... Línea 434...
434
        unset($CFG->recaptchapublickey);
434
        unset($CFG->recaptchapublickey);
435
        unset($CFG->recaptchaprivatekey);
435
        unset($CFG->recaptchaprivatekey);
436
        unset($CFG->enableloginrecaptcha);
436
        unset($CFG->enableloginrecaptcha);
437
    }
437
    }
Línea 438... Línea 438...
438
 
438
 
439
    public function test_user_loggedin_event_exceptions() {
439
    public function test_user_loggedin_event_exceptions(): void {
440
        try {
440
        try {
441
            $event = \core\event\user_loggedin::create(array('objectid' => 1));
441
            $event = \core\event\user_loggedin::create(array('objectid' => 1));
442
            $this->fail('\core\event\user_loggedin requires other[\'username\']');
442
            $this->fail('\core\event\user_loggedin requires other[\'username\']');
443
        } catch(\Exception $e) {
443
        } catch(\Exception $e) {
Línea 446... Línea 446...
446
    }
446
    }
Línea 447... Línea 447...
447
 
447
 
448
    /**
448
    /**
449
     * Test the {@link signup_validate_data()} duplicate email validation.
449
     * Test the {@link signup_validate_data()} duplicate email validation.
450
     */
450
     */
451
    public function test_signup_validate_data_same_email() {
451
    public function test_signup_validate_data_same_email(): void {
452
        global $CFG;
452
        global $CFG;
453
        require_once($CFG->libdir . '/authlib.php');
453
        require_once($CFG->libdir . '/authlib.php');
454
        require_once($CFG->libdir . '/phpmailer/moodle_phpmailer.php');
454
        require_once($CFG->libdir . '/phpmailer/moodle_phpmailer.php');