You are here

protected function DbLogTest::getSeverityConstant in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/dblog/src/Tests/DbLogTest.php \Drupal\dblog\Tests\DbLogTest::getSeverityConstant()

Gets the watchdog severity constant corresponding to the CSS class.

Parameters

string $class: CSS class attribute.

Return value

int|null The watchdog severity constant or NULL if not found.

1 call to DbLogTest::getSeverityConstant()
DbLogTest::getLogEntries in core/modules/dblog/src/Tests/DbLogTest.php
Gets the database log event information from the browser page.

File

core/modules/dblog/src/Tests/DbLogTest.php, line 657
Contains \Drupal\dblog\Tests\DbLogTest.

Class

DbLogTest
Generate events and verify dblog entries; verify user access to log reports based on permissions.

Namespace

Drupal\dblog\Tests

Code

protected function getSeverityConstant($class) {
  $map = array_flip(DbLogController::getLogLevelClassMap());

  // Find the class that contains the severity.
  $classes = explode(' ', $class);
  foreach ($classes as $class) {
    if (isset($map[$class])) {
      return $map[$class];
    }
  }
  return NULL;
}