You are here

protected function MongoDBLogTestCase::find in MongoDB 7

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

Simplified query to look for a logged message.

Parameters

string $message: The message to look for.

Return value

string|null The document matching the message, or NULL if none was found.

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 128
Contains \MongoDBLogTestCase.

Class

MongoDBLogTestCase

Code

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