protected function LoggerTest::find in MongoDB 8.2
Simplified query to look for a logged message.
Parameters
string $message: The message to look for.
Return value
array|null The document containing the message, if any ; NULL otherwise.
2 calls to LoggerTest::find()
- LoggerTest::assertEntry in modules/
mongodb_watchdog/ tests/ src/ Kernel/ LoggerTest.php - Assert that a given entry is present in the watchdog.
- LoggerTest::assertNoEntry in modules/
mongodb_watchdog/ tests/ src/ Kernel/ LoggerTest.php - Assert that a given entry is not present in the watchdog.
File
- modules/
mongodb_watchdog/ tests/ src/ Kernel/ LoggerTest.php, line 115
Class
- LoggerTest
- Class LoggerTest tests the logging mechanism itself.
Namespace
Drupal\Tests\mongodb_watchdog\KernelCode
protected function find($message) {
$ret = $this->collection
->findOne([
'message' => $message,
]);
return $ret;
}