Show
Fresh master installation
Setup
Check that "Enable messaging system (messaging)" is enabled.
Create 2 users: student1 and teacher1.
Create a course.
Enrol student1 as student and teacher1 as editing teacher.
Testing scenario 1: self-conversation
Login as student1.
Click over the message icon to open the message drawer.
CHECK that the self-conversation is displayed in the Starred section.
CHECK the total count is the expected (if only there are a self-conversation, it should be displayed 1).
Access to the self-conversation.
CHECK the self-conversation is opened.
CHECK the header conversation contains the user full name and "Online".
CHECK the header conversation doesn't link to the user profile.
CHECK the header conversation contains a user menu, with the 'Unstar' and 'Delete conversation' options.
CHECK the following self-conversation explanation message is displayed below the header "Personal space. Save draft messages, links, notes etc. to access later. "
Send a message.
CHECK the message is sent.
CHECK the self-conversation explanation message is still displayed.
Access to the home page.
Click over the message icon.
CHECK that the self-conversation is still displayed in the Starred section.
Search the user name or surname for student1 in the message search box.
CHECK that the student1 is displayed on the "Non-contacts" section.
Search some of the texts you've sent.
CHECK that the self-conversation is displayed in the "Messages" section.
Testing scenario 2: create self-conversation from a bulk message
Login as teacher1.
Access to the participants page of the course.
Select student1 and teacher1 and send them a "Bulk message" (selecting the "Send a message" option from the "With selected users..." list).
Send them a message.
Click over the message icon.
CHECK that the self-conversation is displayed in the Starred section and it contains the message sent.
Reply to the message.
CHECK that the message is sent.
Testing scenario 3: export self-conversation
Copy the testexport.php file to the root directory.
Run the php script (testexport.php) to export the user data:
php testexport.php --username={put the student1 username here}
Access to the folder where the export has been uncompressed. I.e.: File export was uncompressed to /stable_master/moodledata/temp/privacy/f586ab14-3414-4b73-ac23-4c859500ed0a and open the index.html in a browser.
Expand the student1 user name from the left column and expand also the Messages folder.
CHECK the userid of the student1 user is present.
Expand the userid of the student1 and open the data.json file.
CHECK the self-messages sent previously are there.
Testing scenario 4: star/unstar and delete self-conversation
Login as student1.
Access to the home page.
Click over the message icon.
Go to the self-conversation.
Display the menu (...) and Unstar the conversation.
Come back, to see the conversation list.
CHECK the self-conversation is now displayed in the 'Private' section.
Access again to the self-conversation.
Display the menu (...) and Star the conversation again.
Display the menu (...) and click over 'Delete conversation'.
Confirm the conversation should be removed.
Access to the home page and click over the message icon.
CHECK the self-conversation is NOT displayed in the 'Starred' neither the 'Private' sections.
Search the user name or surname for student1 in the message search box.
CHECK that the student1 is displayed on the "Non-contacts" section.
Testing scenario 5: create self-conversation from the profile
Login as student1.
Access to the user profile.
CHECK that the "Message" icon and text appears near the user name.
Click the "Message" icon.
CHECK an empty self-conversation is opened.
CHECK the header conversation contains the user full name and "Online".
CHECK the header conversation doesn't link to the user profile.
CHECK the header conversation contains a user menu, with the 'Unstar' and 'Delete conversation' options.
Send a message.
CHECK the message is sent.
Access to the home page.
Click over the message icon.
CHECK that the self-conversation is displayed in the 'Private' section.
CHECK the total count is the expected (if only there are a self-conversation, it should be displayed 1).
Upgrade from 3.4
A. Setup for Moodle 3.4
Login as admin.
Check that "Enable messaging system (messaging)" is enabled.
Create 4 users: t1, s1, s2 and s3.
From "Site administration > Users > Accounts > Bulk user actions", add all the users to the selection (including admin), choose "Send a message", write any text on the message body (for instance " This is a bulk message sent by the ADMIN "), click over the "Save changes" button and confirm you want to send the message to all these users.
Create a course (C1).
Enrol s1, s2 and s3 as students and t1 as editing teacher.
Logout.
Login as t1.
Access to the C1 course's participants page.
Select all the users (including t1), and in the "With selected users..." list choose "Send a message".
Write a message (for instance " This is a bulk message sent by T1 ") and click over the "Send message to x people".
Access to the messages page.
CHECK t1 also appears in the list and his self-conversation contains the previous message.
Send a couple of self-messages more to t1.
Logout.
Login as s2.
Access to the messages page.
Reply to admin message.
Reply to t1 message.
Search for s1 and send him a message.
Search for s3 and send him a message.
Logout.
B. Upgrade to 3.6
Upgrade the code from 3.4 to 3.6.
Login as admin.
Execute the cron.
CHECK the migrate_message_data task is executed (when the cron finishes, all the messages from admin, including the self ones, should be migrated to the new tables).
Access to the messages page using the URL $CFG->wwwroot/message/index.php?id=2 (where 2 should be the admin id).
CHECK admin self-conversation is not empty (it should contain the bulk message sent in step A.4).
Send one self-message more to admin.
CHECK the message can't be sent and a generalexceptionmessage is displayed.
Logout.
C. Upgrade to master
Upgrade the code from 3.6. to master.
Login as admin and follow the upgrading steps.
Click over the message icon to open the message drawer.
CHECK the self-conversation is displayed in the Starred section (it has been migrated using STEP 1 in the upgrade.php).
Access to the self-conversation.
CHECK the self-conversation contains the first bulk message sent using the "Bulk user actions".
CHECK the self-conversation doesn't contain the message sent in step B.7 (because it hasn't been sent).
Login as t1.
Click over the message icon to open the message drawer.
CHECK the self-conversation is displayed in the Starred section (it has been migrated using STEP 2 in the upgrade.php).
Access to the self-conversation.
CHECK the self-conversation contains the second message sent from the course participants page and also the messages send directly by t1 from the messages page in the step A.14.
Login as s1.
Click over the message icon to open the message drawer.
CHECK the self-conversation is displayed in the Starred section.
Access to the self-conversation.
CHECK the self-conversation doesn't contain any message, only the explanation message should be displayed (it has been migrated using STEP 3 in the upgrade.php).
Some comments about where the messages are stored depending on the Moodle version, just in case the reviewer won't be familiarised with the messaging changes and want to check the database content:
In Moodle 3.4, messages can be found in {message} and {message_read} tables, depending if the user has read them or not. Self-messages are always marked as read.
In Moodle 3.6:
When a user log-in, a migrate_message_data task is added to be executed by the cron. This task will migrate legacy messages from {message} and {message_read} to {messages}. Besides, a conversation is created in {message_conversations}, the members for each conversations are saved in {message_conversation_members} and the actions (like read or deleted messages) are stored in {message_conversation_actions}.
For users who don't access, only messages involved with users who have logged-in are migrated. So for the testing instructions, as t1 doesn't log-in to the Moodle 3.6 instance, his messages won't be migrated.
In Moodle 3.7:
All the self-messages are migrated from the legacy {message} and {message_read} tables.
A new conversation type has been added for the self-conversations (3) and {message_conversation_members}for self-conversations should contain only one member.
Besides, some PHPUnit tests have been reviewed/added to cover the API changes.