Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Class: maildigest_test  - X-Ref

The module forums external functions unit tests

setUp()   X-Ref
Set up message and mail sinks, and set up other requirements for the
cron to be tested here.


tearDown()   X-Ref
Clear the message sinks set up in this test.


helper_setup_user_in_course()   X-Ref
Setup a user, course, and forums.

return: stdClass containing the list of forums, courses, forumids,

test_set_maildigest()   X-Ref
No description

test_get_user_digest_options_default()   X-Ref
No description

test_get_user_digest_options_sorting()   X-Ref
No description

test_cron_no_posts()   X-Ref
No description

test_cron_profile_single_mails()   X-Ref
Sends several notifications to one user as:
* single messages based on a user profile setting.


test_cron_profile_digest_email()   X-Ref
Sends several notifications to one user as:
* daily digests coming from the user profile setting.


test_cron_digest_view_fullnames_off()   X-Ref
Send digests to a user who cannot view fullnames


test_cron_digest_view_fullnames_on()   X-Ref
Send digests to a user who can view fullnames.


test_cron_mixed_email_1()   X-Ref
Sends several notifications to one user as:
* daily digests coming from the per-forum setting; and
* single e-mails from the profile setting.


test_cron_mixed_email_2()   X-Ref
Sends several notifications to one user as:
* single e-mails from the per-forum setting; and
* daily digests coming from the per-user setting.


test_cron_forum_digest_email()   X-Ref
Sends several notifications to one user as:
* daily digests coming from the per-forum setting.


test_cron_digest_previous_day()   X-Ref
The digest being in the past is queued til the next day.


test_cron_digest_same_day()   X-Ref
The digest being in the future is queued for today.


test_cron_digest_queue_next_before_current_processed()   X-Ref
Tests that if a new message is posted after the days digest time,
but before that days digests are sent a new task is created.


test_cron_digest_marks_posts_read()   X-Ref
The sending of a digest marks posts as read if automatic message read marking is set.


test_cron_digest_leaves_posts_unread()   X-Ref
The sending of a digest does not mark posts as read when manual message read marking is set.