protected function MongoDBLogTestCase::checkCollection in MongoDB 6
Same name and namespace in other branches
- 8 mongodb_watchdog/mongodb_watchdog.test \MongoDBLogTestCase::checkCollection()
- 7 mongodb_watchdog/mongodb_watchdog.test \MongoDBLogTestCase::checkCollection()
Ensure collection is available, inform on behalf of caller if if is not.
Return value
bool Did the collection exist and contain data ?
1 call to MongoDBLogTestCase::checkCollection()
- 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 165 - Test class for MongoDB_watchdog.
Class
- MongoDBLogTestCase
- Test the behaviour of watchdog() mongodb_watchdog, not dblog.
Code
protected function checkCollection() {
if (!empty($this->collection)) {
return TRUE;
}
$stack = debug_backtrace();
$method = $stack[1]['function'];
if (strtolower(substr($method, 0, 4)) == 'test') {
$this
->pass(t('%test test skipped: no collection.', array(
'%test' => substr($method, 4),
)), $this->group);
}
return FALSE;
}