You are here

protected function MongoDBLogTestCase::find in MongoDB 6

Same name and namespace in other branches
  1. 8 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: The message to look for.

Return value

string|NULL The find() result.

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 131
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;
}