MDL-71919 core_message: Fix tests in message_send

This commit is contained in:
cescobedo 2021-07-08 09:24:00 +02:00 committed by Eloy Lafuente (stronk7)
parent f21ac401e2
commit 084833acbe
2 changed files with 3 additions and 3 deletions

View File

@ -174,7 +174,7 @@ class core_message_testcase extends advanced_testcase {
$this->assertSame(get_string('unreadnewmessage', 'message', fullname($user1)), $email->subject);
$this->assertNotEmpty($email->header);
$this->assertNotEmpty($email->body);
$this->assertMatchesRegularExpression('/test message body.*test/s', $email->body);
$this->assertMatchesRegularExpression('/test.*message body.*test/s', $email->body);
$sink->clear();
// Test that event fired includes the courseid.
@ -214,7 +214,7 @@ class core_message_testcase extends advanced_testcase {
$this->assertSame(get_string('unreadnewmessage', 'message', fullname($user1)), $email->subject);
$this->assertNotEmpty($email->header);
$this->assertNotEmpty($email->body);
$this->assertDoesNotMatchRegularExpression('/test message body test/', $email->body);
$this->assertDoesNotMatchRegularExpression('/test.*message body test/', $email->body);
// Test that event fired includes the courseid.
$eventsink = $this->redirectEvents();

View File

@ -808,7 +808,7 @@ class core_messagelib_testcase extends advanced_testcase {
// so verify the expected beginning and ends.
$this->assertNotEmpty($email->header);
$this->assertNotEmpty($email->body);
$this->assertMatchesRegularExpression('/test message body.*test/s', $email->body);
$this->assertMatchesRegularExpression('/test.*message body.*test/s', $email->body);
$sink->clear();
// Now, send the message again, and verify that the event fired includes the courseid and conversationid.