Skip to content

Commit

Permalink
Moodle code-checker fixes for test folder.
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnOLane committed Jul 15, 2024
1 parent 17842c3 commit a81390c
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/advanced_passcode_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand Down
2 changes: 2 additions & 0 deletions tests/error_handling_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,15 @@ 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');
}

/**
* 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);
Expand Down
1 change: 1 addition & 0 deletions tests/get_meeting_reports_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 2 additions & 0 deletions tests/mod_zoom_grade_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand All @@ -63,6 +64,7 @@ public static function setUpBeforeClass(): void {
* Setup before every test.
*/
public function setUp(): void {
parent::setUp();
$this->resetAfterTest();
$this->setAdminUser();

Expand Down
2 changes: 2 additions & 0 deletions tests/mod_zoom_invitation_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,15 @@ final class mod_zoom_invitation_test extends advanced_testcase {
*/
public static function setUpBeforeClass(): void {
global $CFG;
parent::setUpBeforeClass();
require_once($CFG->libdir . '/accesslib.php');
}

/**
* Run before every test.
*/
protected function setUp(): void {
parent::setUp();
set_config('invitationregexenabled', 1, 'zoom');
}

Expand Down
2 changes: 2 additions & 0 deletions tests/mod_zoom_webservice_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,15 @@ 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');
}

/**
* 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');
Expand Down
1 change: 1 addition & 0 deletions tests/privacy/mod_zoom_provider_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ final class mod_zoom_provider_test extends provider_testcase {
* {@inheritdoc}
*/
protected function setUp(): void {
parent::setUp();
$this->resetAfterTest();
$this->setAdminUser();

Expand Down

0 comments on commit a81390c

Please sign in to comment.