function LoginSecurityUserBlockingTest::testDrupalErrorToggle in Login Security 6
Same name and namespace in other branches
- 7 login_security.test \LoginSecurityUserBlockingTest::testDrupalErrorToggle()
File
- ./login_security.test, line 111
- Test the basic functions of the Login Security module.
Class
- LoginSecurityUserBlockingTest
Code
function testDrupalErrorToggle() {
$normal_user = $this
->drupalCreateUser(array(
'access content',
));
$normal_user->pass_raw = user_password();
variable_set('login_security_disable_core_login_error', 0);
$this
->drupalLoginLite($normal_user);
$this
->assertRaw(t('Sorry, unrecognized username or password. <a href="@password">Have you forgotten your password?</a>', array(
'@password' => url('user/password'),
)), t('Drupal login error message found.'));
variable_set('login_security_disable_core_login_error', 1);
$this
->drupalLoginLite($normal_user);
$this
->assertNoRaw(t('Sorry, unrecognized username or password. <a href="@password">Have you forgotten your password?</a>', array(
'@password' => url('user/password'),
)), t('Drupal login error message not found.'));
}