You are here

protected function MongoDBLogTestCase::find in MongoDB 8

Same name and namespace in other branches
  1. 6 mongodb_watchdog/mongodb_watchdog.test \MongoDBLogTestCase::find()
  2. 7 mongodb_watchdog/mongodb_watchdog.test \MongoDBLogTestCase::find()

Simplified query to look for a logged message.

Parameters

string $message:

Return value

string|NULL

2 calls to MongoDBLogTestCase::find()
MongoDBLogTestCase::assertEntry in mongodb_watchdog/mongodb_watchdog.test
Assert that a given entry is present in the watchdog.
MongoDBLogTestCase::assertNoEntry in mongodb_watchdog/mongodb_watchdog.test
Assert that a given entry is not present in the watchdog.

File

mongodb_watchdog/mongodb_watchdog.test, line 114
Test class for MongoDB_watchdog.

Class

MongoDBLogTestCase
Test the behaviour of watchdog() mongodb_watchdog, not dblog

Code

protected function find($message) {
  $ret = $this->collection
    ->findOne(array(
    'message' => $message,
  ));
  return $ret;
}