You are here

protected function PatchInfoTestTrait::getWatchdogMessageCount in PatchInfo 8.2

Gets number of log entries in watchdog table with a particular message.

Parameters

string $type: Message type.

int $severity: Message severity.

string $watchdog_message: Message to get count for. Do not translate messages: use strtr() to embed variables in the message text, not t().

Return value

int Number of log entries in watchdog table with a particular message.

See also

\Drupal\Core\Logger\RfcLogLevel

2 calls to PatchInfoTestTrait::getWatchdogMessageCount()
PatchInfoTestTrait::assertNoWatchdogMessage in tests/src/Traits/PatchInfoTestTrait.php
Asserts that a watchdog message does not exist.
PatchInfoTestTrait::assertWatchdogMessage in tests/src/Traits/PatchInfoTestTrait.php
Asserts that a watchdog message exists.

File

tests/src/Traits/PatchInfoTestTrait.php, line 209

Class

PatchInfoTestTrait
Provides common methods for functional tests of PatchInfo module.

Namespace

Drupal\Tests\patchinfo\Traits

Code

protected function getWatchdogMessageCount($type, $severity, $watchdog_message) {
  return (int) $this->container
    ->get('database')
    ->select('watchdog', 'w')
    ->condition('w.message', $watchdog_message)
    ->condition('w.type', $type)
    ->countQuery()
    ->execute()
    ->fetchField();
}