コード例 #1
0
 /**
  * Test deleting conversation with messaging disabled.
  */
 public function test_delete_conversation_messaging_disabled()
 {
     global $CFG;
     $this->resetAfterTest(true);
     // Create some users.
     $user1 = self::getDataGenerator()->create_user();
     $user2 = self::getDataGenerator()->create_user();
     // The person wanting to delete the conversation.
     $this->setUser($user1);
     // Disable messaging.
     $CFG->messaging = 0;
     // Ensure an exception is thrown.
     $this->expectException('moodle_exception');
     core_message_external::delete_conversation($user1->id, $user2->id);
 }