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.

(no description)

File Size: 414 lines (17 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: migrate_message_data_test  - X-Ref

Class for testing the migrate message data task.

setUp()   X-Ref
Test set up.

This is executed before running any test in this file.

test_migrating_messages()   X-Ref
Test migrating legacy messages.


test_migrating_notifications()   X-Ref
Test migrating legacy notifications.


test_migrating_message_null_format()   X-Ref
Test migrating a legacy message that contains null as the format.


test_migrating_notification_null_format()   X-Ref
Test migrating a legacy notification that contains null as the format.


test_migrating_message_deleted_message_sent_to_self()   X-Ref
Test migrating a legacy message that a user sent to themselves then deleted.


create_legacy_message_or_notification($useridfrom, $useridto, $timecreated = null,$notification = false, $timeread = null, $format = FORMAT_PLAIN)   X-Ref
Creates a legacy message or notification to be used for testing.

param: int $useridfrom The user id from
param: int $useridto The user id to
param: int $timecreated
param: bool $notification
param: int|null $timeread The time the message/notification was read, null if it hasn't been.
param: string|int|null $format The format of the message.
return: int The id of the message (in either the message or message_read table)