Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.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)