Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 39 and 310]

Tests the migrate message data task.

Copyright: 2018 Mark Nelson <markn@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 421 lines (17 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: core_message_migrate_message_data_task_testcase  - 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)