public function LoginSecuritySoftBlockTest::testLogin in Login Security 2.x
Test login attempts.
File
- tests/
src/ Functional/ LoginSecuritySoftBlockTest.php, line 44
Class
- LoginSecuritySoftBlockTest
- Test Login Security's soft blocking restrictions.
Namespace
Drupal\Tests\login_security\FunctionalCode
public function testLogin() {
// Set wrong count to 5 attempts.
\Drupal::configFactory()
->getEditable('login_security.settings')
->set('user_wrong_count', 5)
->save();
$normal_user = $this
->drupalCreateUser();
$this
->drupalLogin($normal_user);
$warning_message = 'You have used 1 out of 5 login attempts. After all 5 have been used, you will be unable to login.';
$this
->assertNoText($warning_message, 'Attempts available message displayed.');
}