MDL-63130 core_message: add unit test

This commit is contained in:
Mark Nelson
2018-09-06 18:16:33 +08:00
parent f88cc4ccae
commit 8a261177f7
+12
View File
@@ -270,6 +270,18 @@ class core_message_messagelib_testcase extends advanced_testcase {
$this->assertEquals(0, message_count_unread_messages($userto, $userfrom1));
}
/**
* Test message_count_unread_messages with sent messages.
*/
public function test_message_count_unread_messages_with_sent_messages() {
$userfrom = $this->getDataGenerator()->create_user();
$userto = $this->getDataGenerator()->create_user();
$this->send_fake_message($userfrom, $userto);
$this->assertEquals(0, message_count_unread_messages($userfrom));
}
/**
* Test message_add_contact.
*/