You are here

protected function LoginSecurityUserBlockingTest::getLogMessages in Login Security 2.x

Retrieve log records from the watchdog table.

Return value

array The log messages.

1 call to LoginSecurityUserBlockingTest::getLogMessages()
LoginSecurityUserBlockingTest::testThresholdNotify in tests/src/Functional/LoginSecurityUserBlockingTest.php
Test threshold notify functionality.

File

tests/src/Functional/LoginSecurityUserBlockingTest.php, line 121

Class

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

Namespace

Drupal\Tests\login_security\Functional

Code

protected function getLogMessages() {
  return \Drupal::database()
    ->select('watchdog', 'w')
    ->fields('w', [
    'wid',
    'message',
    'variables',
    'severity',
  ])
    ->condition('w.type', 'login_security')
    ->execute()
    ->fetchAllAssoc('wid');
}