You are here

public function LoginSecurityEmailTest::setUp in Login Security 2.x

Overrides LoginSecurityTestBase::setUp

File

tests/src/Functional/LoginSecurityEmailTest.php, line 33

Class

LoginSecurityEmailTest
Test that emails are properly sent when configured.

Namespace

Drupal\Tests\login_security\Functional

Code

public function setUp() {
  parent::setUp();

  // Create first user.
  $this
    ->drupalCreateUser();

  // Create second user.
  $this->account = $this
    ->drupalCreateUser();
  $this
    ->drupalLoginLite($this->account);

  // Setup emails to be sent.
  \Drupal::configFactory()
    ->getEditable('login_security.settings')
    ->set('user_blocked_notification_emails', 'test@test.com')
    ->set('login_activity_notification_emails', 'test@test.com')
    ->save();
}