Merge branch 'MDL-77252-master-fix' of https://github.com/davewoloszyn/moodle

This commit is contained in:
Andrew Nicols 2023-05-26 11:12:44 +08:00
commit 0f25d9360d
No known key found for this signature in database
GPG key ID: 6D1E3157C8CFBF14

View file

@ -898,6 +898,8 @@ class matrix_communication_test extends \advanced_testcase {
// Room should be in 'pending' state before the task is run and show a notification. // Room should be in 'pending' state before the task is run and show a notification.
$communication->show_communication_room_status_notification(); $communication->show_communication_room_status_notification();
$notifications = \core\notification::fetch();
$this->assertStringContainsString('Your Matrix room will be ready soon.', $notifications[0]->get_message());
// Run the task. // Run the task.
$this->runAdhocTasks('\core_communication\task\create_and_configure_room_task'); $this->runAdhocTasks('\core_communication\task\create_and_configure_room_task');
@ -911,12 +913,7 @@ class matrix_communication_test extends \advanced_testcase {
// Check the room is now in 'ready' state and show a notification. // Check the room is now in 'ready' state and show a notification.
$communication->show_communication_room_status_notification(); $communication->show_communication_room_status_notification();
// Get our notifications stack.
// There should be one for 'pending' status, and one for 'ready' status.
$notifications = \core\notification::fetch(); $notifications = \core\notification::fetch();
$this->assertCount(2, $notifications); $this->assertStringContainsString('Your Matrix room is ready!', $notifications[0]->get_message());
$this->assertStringContainsString('Your Matrix room will be ready soon.', $notifications[0]->get_message());
$this->assertStringContainsString('Your Matrix room is ready!', $notifications[1]->get_message());
} }
} }