From a81390c742662148e63e9b6844e142b5005a145f Mon Sep 17 00:00:00 2001 From: John Lane <46030891+JohnOLane@users.noreply.github.com> Date: Mon, 15 Jul 2024 12:28:34 -0600 Subject: [PATCH] Moodle code-checker fixes for test folder. --- tests/advanced_passcode_test.php | 1 + tests/error_handling_test.php | 2 ++ tests/get_meeting_reports_test.php | 1 + tests/mod_zoom_grade_test.php | 2 ++ tests/mod_zoom_invitation_test.php | 2 ++ tests/mod_zoom_webservice_test.php | 2 ++ tests/privacy/mod_zoom_provider_test.php | 1 + 7 files changed, 11 insertions(+) diff --git a/tests/advanced_passcode_test.php b/tests/advanced_passcode_test.php index 54d7e87e..d25621b7 100644 --- a/tests/advanced_passcode_test.php +++ b/tests/advanced_passcode_test.php @@ -58,6 +58,7 @@ public static function assertMatchesRegularExpression($pattern, $string, $messag */ public static function setUpBeforeClass(): void { global $CFG; + parent::setUpBeforeClass(); require_once($CFG->dirroot . '/mod/zoom/locallib.php'); } diff --git a/tests/error_handling_test.php b/tests/error_handling_test.php index 729a4f1f..e1ff1807 100644 --- a/tests/error_handling_test.php +++ b/tests/error_handling_test.php @@ -61,6 +61,7 @@ final class error_handling_test extends basic_testcase { */ public static function setUpBeforeClass(): void { global $CFG; + parent::setUpBeforeClass(); require_once($CFG->dirroot . '/mod/zoom/locallib.php'); } @@ -68,6 +69,7 @@ public static function setUpBeforeClass(): void { * Setup before every test. */ public function setUp(): void { + parent::setUp(); $this->meetingnotfoundexception = new not_found_exception('meeting not found', 3001); $this->usernotfoundexception = new not_found_exception('user not found', 1001); $this->invaliduserexception = new not_found_exception('invalid user found', 1120); diff --git a/tests/get_meeting_reports_test.php b/tests/get_meeting_reports_test.php index 273b07b1..2174daf5 100644 --- a/tests/get_meeting_reports_test.php +++ b/tests/get_meeting_reports_test.php @@ -69,6 +69,7 @@ public function mock_get_meeting_participants($meetinguuid, $webinar) { * Setup. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); $this->meetingtask = new \mod_zoom\task\get_meeting_reports(); diff --git a/tests/mod_zoom_grade_test.php b/tests/mod_zoom_grade_test.php index 8d8f41ad..19c7993d 100644 --- a/tests/mod_zoom_grade_test.php +++ b/tests/mod_zoom_grade_test.php @@ -55,6 +55,7 @@ final class mod_zoom_grade_test extends advanced_testcase { */ public static function setUpBeforeClass(): void { global $CFG; + parent::setUpBeforeClass(); require_once($CFG->dirroot . '/mod/zoom/lib.php'); require_once($CFG->dirroot . '/mod/zoom/locallib.php'); } @@ -63,6 +64,7 @@ public static function setUpBeforeClass(): void { * Setup before every test. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); $this->setAdminUser(); diff --git a/tests/mod_zoom_invitation_test.php b/tests/mod_zoom_invitation_test.php index 9b8f9004..4d52b8b5 100644 --- a/tests/mod_zoom_invitation_test.php +++ b/tests/mod_zoom_invitation_test.php @@ -40,6 +40,7 @@ final class mod_zoom_invitation_test extends advanced_testcase { */ public static function setUpBeforeClass(): void { global $CFG; + parent::setUpBeforeClass(); require_once($CFG->libdir . '/accesslib.php'); } @@ -47,6 +48,7 @@ public static function setUpBeforeClass(): void { * Run before every test. */ protected function setUp(): void { + parent::setUp(); set_config('invitationregexenabled', 1, 'zoom'); } diff --git a/tests/mod_zoom_webservice_test.php b/tests/mod_zoom_webservice_test.php index 1e2ebd06..60e21060 100644 --- a/tests/mod_zoom_webservice_test.php +++ b/tests/mod_zoom_webservice_test.php @@ -41,6 +41,7 @@ final class mod_zoom_webservice_test extends advanced_testcase { */ public static function setUpBeforeClass(): void { global $CFG; + parent::setUpBeforeClass(); require_once($CFG->dirroot . '/mod/zoom/locallib.php'); } @@ -48,6 +49,7 @@ public static function setUpBeforeClass(): void { * Setup before every test. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); // Set fake values so we can test methods in class. set_config('clientid', 'test', 'zoom'); diff --git a/tests/privacy/mod_zoom_provider_test.php b/tests/privacy/mod_zoom_provider_test.php index 85efec3d..ce69d9d6 100644 --- a/tests/privacy/mod_zoom_provider_test.php +++ b/tests/privacy/mod_zoom_provider_test.php @@ -55,6 +55,7 @@ final class mod_zoom_provider_test extends provider_testcase { * {@inheritdoc} */ protected function setUp(): void { + parent::setUp(); $this->resetAfterTest(); $this->setAdminUser();