You are here

protected function ControllerTest::getSeverityConstant in MongoDB 8.2

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 ControllerTest::getSeverityConstant()
ControllerTest::getLogEntries in modules/mongodb_watchdog/tests/src/Functional/ControllerTest.php
Get the log entry information form the page.

File

modules/mongodb_watchdog/tests/src/Functional/ControllerTest.php, line 308

Class

ControllerTest
Test the MongoDB report controllers.

Namespace

Drupal\Tests\mongodb_watchdog\Functional

Code

protected function getSeverityConstant(string $class) : int {

  // Class: "mongodb-watchdog__severity--(level)", prefix length = 28.
  $level = substr($class, 28);
  return static::LEVEL_TRANSLATION[$level];
}