You are here

public function MongoDBLogTestCase::assertEntry in MongoDB 7

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

Assert that a given entry is present in the watchdog.

Parameters

string $message: The message to look for.

1 call to MongoDBLogTestCase::assertEntry()
MongoDBLogTestCase::testWatchdogLimit in mongodb_watchdog/mongodb_watchdog.test
Test the default and non-default mongodb_watchdog insertion behaviours.

File

mongodb_watchdog/mongodb_watchdog.test, line 139
Contains \MongoDBLogTestCase.

Class

MongoDBLogTestCase

Code

public function assertEntry($message) {
  $logged = $this
    ->find($message);
  $this
    ->assertNotNull($logged, t('Event %message is logged', array(
    '%message' => $message,
  )), $this->group);
  $this
    ->assertTrue(isset($logged['message']) && $logged['message'] == $message, t('Logged message is unchanged'), $this->group);
}