You are here

function NotificationsBasicTests::countQueued in Notifications 6.2

Same name and namespace in other branches
  1. 6 tests/notifications_api.test \NotificationsBasicTests::countQueued()
  2. 6.3 tests/notifications_api.test \NotificationsBasicTests::countQueued()

Helper function. Simple row counting with conditions, uses query builder

2 calls to NotificationsBasicTests::countQueued()
NotificationsBasicTests::testNotificationsBasicAPI in tests/notifications_api.test
Play with creating, retrieving, deleting a pair subscriptions
NotificationsBasicTests::testNotificationsQueryBuilder in tests/notifications_api.test
Test query builder

File

tests/notifications_api.test, line 153

Class

NotificationsBasicTests
Class for testing notifications module. Tests basic API functions

Code

function countQueued($params = NULL) {
  if ($params) {
    $query = notifications_queue_query($params);
    return db_result(db_query('SELECT COUNT(*) FROM {notifications_queue} WHERE ' . implode(' AND ', $query['where']), $query['args']));
  }
  else {
    return db_result(db_query('SELECT COUNT(*) FROM {notifications_queue}'));
  }
}