function UserValidationTestCase::testAlteredMailValidation

File

modules/user/user.test, line 313

Class

UserValidationTestCase

Code

function testAlteredMailValidation() {
    // This e-mail is considered as valid.
    $mail = 'foo@example.local';
    $this->assertNull(user_validate_mail($mail), 'E-mail address is valid.');
    // Invalidate all emails ending with .local in alter hook.
    module_enable(array(
        'user_email_validation_test',
    ));
    $this->assertNotNull(user_validate_mail($mail), 'E-mail address is invalid.');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.