From c4e07686ea34eec7f869ce5744abd77c6dbb76d5 Mon Sep 17 00:00:00 2001 From: Huong Nguyen Date: Tue, 30 Jan 2024 11:23:09 +0700 Subject: [PATCH] MDL-4188 core_message: Modify PHPUnit to turn off course welcome message --- message/tests/privacy/provider_test.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/message/tests/privacy/provider_test.php b/message/tests/privacy/provider_test.php index 9df8c83204f..5f5a59181a4 100644 --- a/message/tests/privacy/provider_test.php +++ b/message/tests/privacy/provider_test.php @@ -41,10 +41,20 @@ defined('MOODLE_INTERNAL') || die(); */ class provider_test extends \core_privacy\tests\provider_testcase { + /** + * Setup. + */ + protected function setUp(): void { + parent::setUp(); + // Turn off the course welcome message, so we can easily test other messages. + set_config('sendcoursewelcomemessage', 0, 'enrol_manual'); + } + /** * Test for provider::get_metadata(). */ public function test_get_metadata() { + $this->resetAfterTest(); $collection = new collection('core_message'); $newcollection = provider::get_metadata($collection); $itemcollection = $newcollection->get_collection();