function NotificationsLiteTests::sendLiteMessages in Notifications 6.3
Same name and namespace in other branches
- 6.4 tests/notifications_lite.test \NotificationsLiteTests::sendLiteMessages()
- 6.2 tests/notifications_lite.test \NotificationsLiteTests::sendLiteMessages()
- 7 tests/notifications_lite.test \NotificationsLiteTests::sendLiteMessages()
1 call to NotificationsLiteTests::sendLiteMessages()
- NotificationsLiteTests::testNotificationsLite in tests/
notifications_lite.test - Test simple sending cases
File
- tests/
notifications_lite.test, line 100
Class
Code
function sendLiteMessages($uid, $count) {
$messages = array();
for ($i = 1; $i <= $count; $i++) {
$msg = new Stdclass();
$msg->subject = "Lite Subject {$i}";
$msg->body = "Body for message {$i}";
notifications_lite_send($uid, $msg->subject, $msg->body);
$messages[$i] = $msg;
}
// There should be one queued notification and one event for each message
$this
->assertUserRows('notifications_queue', $count, $uid, "We have {$count} notifications in queue");
$rows = notifications_process_rows(array(
'uid' => $uid,
));
$this
->assertEqual($count, $rows, "Processed all rows in queue ({$rows})");
return $messages;
}