protected function LoginSecurityTestBase::drupalLoginLite in Login Security 2.x
Alternative to drupalLogin().
5 calls to LoginSecurityTestBase::drupalLoginLite()
- LoginSecurityEmailTest::setUp in tests/
src/ Functional/ LoginSecurityEmailTest.php - LoginSecuritySoftBlockTest::assertNoSoftBlocked in tests/
src/ Functional/ LoginSecuritySoftBlockTest.php - Checks whether the request is not Soft Blocked.
- LoginSecuritySoftBlockTest::assertSoftBlocked in tests/
src/ Functional/ LoginSecuritySoftBlockTest.php - Checks whether the request is Soft Blocked.
- LoginSecurityUserBlockingTest::testDrupalErrorToggle in tests/
src/ Functional/ LoginSecurityUserBlockingTest.php - Test disable core login error toggle.
- LoginSecurityUserBlockingTest::testUserBlocking in tests/
src/ Functional/ LoginSecurityUserBlockingTest.php - Test user blocking.
File
- tests/
src/ Functional/ LoginSecurityTestBase.php, line 72
Class
- LoginSecurityTestBase
- Helper test class with some added functions for testing.
Namespace
Drupal\Tests\login_security\FunctionalCode
protected function drupalLoginLite($user) {
if ($this
->drupalUserIsLoggedIn($user)) {
$this
->drupalLogout();
}
$edit = [
'name' => $user
->getAccountName(),
'pass' => $user
->getPassword(),
];
$this
->drupalPostForm('user', $edit, $this
->t('Log in'));
$this
->assertResponse(200, $this
->t('Login page reloaded.'));
$this->loggedInUser = TRUE;
}