You are here

protected function LoginSecurityUserBlockingTest::assertBlockedUser in Login Security 8

Asserts a blocked user log was set.

Parameters

object $log: The raw log record from the database.

string $username: The blocked username.

1 call to LoginSecurityUserBlockingTest::assertBlockedUser()
LoginSecurityUserBlockingTest::testThresholdNotify in src/Tests/LoginSecurityUserBlockingTest.php
Test threshold notify functionality.

File

src/Tests/LoginSecurityUserBlockingTest.php, line 103

Class

LoginSecurityUserBlockingTest
Test Login Security's user-blocking restrictions and default messages.

Namespace

Drupal\login_security\Tests

Code

protected function assertBlockedUser($log, $username) {
  $variables = [
    '@username' => $username,
  ];
  $expected = SafeMarkup::format('Blocked user @username due to security configuration.', $variables);
  $this
    ->assertEqual(SafeMarkup::format($log->message, unserialize($log->variables)), $expected, 'User blocked log was set.');
  $this
    ->assertEqual($log->severity, RfcLogLevel::NOTICE, 'User blocked log was of severity "Notice".');
}