diff --git a/tests/advanced_passcode_test.php b/tests/advanced_passcode_test.php index 0f71df62..77549162 100644 --- a/tests/advanced_passcode_test.php +++ b/tests/advanced_passcode_test.php @@ -65,7 +65,7 @@ public static function setUpBeforeClass(): void { * Tests that a default password of 6 numbers is created when settings are null. * @covers ::zoom_create_default_passcode */ - public function test_settings_default() { + public function test_settings_default(): void { $this->zoomdata = (object) webservice::DEFAULT_MEETING_PASSWORD_REQUIREMENT; $passcode = zoom_create_default_passcode($this->zoomdata); @@ -77,7 +77,7 @@ public function test_settings_default() { * Tests that a password has the given minimum length. * @covers ::zoom_create_default_passcode */ - public function test_settings_length() { + public function test_settings_length(): void { $data = [ 'length' => 8, 'have_letter' => false, @@ -95,7 +95,7 @@ public function test_settings_length() { * Tests that a password is all numbers when the setting is specified. * @covers ::zoom_create_default_passcode */ - public function test_settings_only_numeric() { + public function test_settings_only_numeric(): void { $data = [ 'length' => 10, 'have_letter' => false, @@ -114,7 +114,7 @@ public function test_settings_only_numeric() { * Tests that a password has a letter when the setting is specified. * @covers ::zoom_create_default_passcode */ - public function test_settings_letter() { + public function test_settings_letter(): void { $data = [ 'length' => null, 'have_letter' => true, @@ -133,7 +133,7 @@ public function test_settings_letter() { * Tests that a password has uppercase and lowercase letters when the setting is specified. * @covers ::zoom_create_default_passcode */ - public function test_settings_upper_and_lower_letters() { + public function test_settings_upper_and_lower_letters(): void { $data = [ 'length' => null, 'have_letter' => true, @@ -153,7 +153,7 @@ public function test_settings_upper_and_lower_letters() { * Tests that a password has a special character when the setting is specified. * @covers ::zoom_create_default_passcode */ - public function test_settings_special_character() { + public function test_settings_special_character(): void { $data = [ 'length' => null, 'have_letter' => null, @@ -172,7 +172,7 @@ public function test_settings_special_character() { * Tests that a password has correct length, a letter, and a special character when setting is specified. * @covers ::zoom_create_default_passcode */ - public function test_settings_all() { + public function test_settings_all(): void { $data = [ 'length' => 7, 'have_letter' => true, @@ -192,7 +192,7 @@ public function test_settings_all() { * Tests that the password description is correct when all settings are present. * @covers ::zoom_create_passcode_description */ - public function test_pasword_description_all() { + public function test_pasword_description_all(): void { $data = [ 'length' => 9, 'have_letter' => true, @@ -215,7 +215,7 @@ public function test_pasword_description_all() { * Tests that the password description is correct when the only numeric option is present. * @covers ::zoom_create_passcode_description */ - public function test_pasword_description_only_numeric() { + public function test_pasword_description_only_numeric(): void { $data = [ 'length' => 8, 'have_letter' => false, @@ -237,7 +237,7 @@ public function test_pasword_description_only_numeric() { * Tests that the password description is correct when the default settings are present. * @covers ::zoom_create_passcode_description */ - public function test_pasword_description_default() { + public function test_pasword_description_default(): void { $this->zoomdata = (object) webservice::DEFAULT_MEETING_PASSWORD_REQUIREMENT; $description = zoom_create_passcode_description($this->zoomdata); diff --git a/tests/error_handling_test.php b/tests/error_handling_test.php index 78e4f46e..51446625 100644 --- a/tests/error_handling_test.php +++ b/tests/error_handling_test.php @@ -79,7 +79,7 @@ public function setUp(): void { * @covers ::zoom_is_meeting_gone_error * @covers ::zoom_is_user_not_found_error */ - public function test_correct_error_recognition() { + public function test_correct_error_recognition(): void { // Check meeting not found behavior. $this->assertTrue(zoom_is_meeting_gone_error($this->meetingnotfoundexception)); $this->assertTrue(zoom_is_meeting_gone_error($this->usernotfoundexception)); diff --git a/tests/get_meeting_reports_test.php b/tests/get_meeting_reports_test.php index 09b264d9..06d02208 100644 --- a/tests/get_meeting_reports_test.php +++ b/tests/get_meeting_reports_test.php @@ -85,7 +85,7 @@ public function setUp(): void { /** * Make sure that format_participant() filters bad data from Zoom. */ - public function test_format_participant_filtering() { + public function test_format_participant_filtering(): void { // Sometimes Zoom has a # instead of comma in the name. $this->zoomdata->name = 'SMITH# JOE'; $participant = $this->meetingtask->format_participant($this->zoomdata, 1, [], []); @@ -95,7 +95,7 @@ public function test_format_participant_filtering() { /** * Make sure that format_participant() can match Moodle users. */ - public function test_format_participant_matching() { + public function test_format_participant_matching(): void { global $DB; return; @@ -186,7 +186,7 @@ public function test_format_participant_matching() { * Make sure that format_participant() can match Moodle users more * aggressively on name. */ - public function test_format_participant_name_matching() { + public function test_format_participant_name_matching(): void { // Enroll a bunch of users. Note: names were generated by // https://www.behindthename.com/random/ and any similarity to anyone // real or ficitional is concidence and not intentional. @@ -252,7 +252,7 @@ public function test_format_participant_name_matching() { * Tests that we can handle when the Zoom API sometimes returns invalid * userids in the report/meeting/participants call. */ - public function test_invalid_userids() { + public function test_invalid_userids(): void { global $DB, $SITE; // Make sure we start with nothing. @@ -342,7 +342,7 @@ public function test_invalid_userids() { * Tests that normalize_meeting() can handle different meeting records from * Dashboard API versus the Report API. */ - public function test_normalize_meeting() { + public function test_normalize_meeting(): void { $dashboardmeeting = [ 'uuid' => 'sfsdfsdfc6122222d', 'id' => 1000000, diff --git a/tests/mod_zoom_grade_test.php b/tests/mod_zoom_grade_test.php index f8a8e1cd..22fade56 100644 --- a/tests/mod_zoom_grade_test.php +++ b/tests/mod_zoom_grade_test.php @@ -76,7 +76,7 @@ public function setUp(): void { * Tests that Zoom grades can be added and updated in the gradebook. * @covers ::zoom_grade_item_update */ - public function test_grade_added() { + public function test_grade_added(): void { $params['course'] = $this->course->id; $params['grade'] = 100; @@ -109,7 +109,7 @@ public function test_grade_added() { * Tests that the Zoom grade type cannot be changed to NONE if grades are already inputted. * @covers ::zoom_grade_item_update */ - public function test_grade_type_not_none() { + public function test_grade_type_not_none(): void { $params['course'] = $this->course->id; $params['grade'] = 100; @@ -140,7 +140,7 @@ public function test_grade_type_not_none() { * Tests that the Zoom grades can be deleted. * @covers ::zoom_grade_item_delete */ - public function test_grade_delete() { + public function test_grade_delete(): void { $params['course'] = $this->course->id; $params['grade'] = 100; diff --git a/tests/mod_zoom_invitation_test.php b/tests/mod_zoom_invitation_test.php index 3a6aa0b7..477e3482 100644 --- a/tests/mod_zoom_invitation_test.php +++ b/tests/mod_zoom_invitation_test.php @@ -53,7 +53,7 @@ protected function setUp(): void { /** * Test zoom invitation display message for user with all capabilities. */ - public function test_display_message_when_user_has_all_capabilities() { + public function test_display_message_when_user_has_all_capabilities(): void { $this->resetAfterTest(); $this->setAdminUser(); $course = $this->getDataGenerator()->create_course(); @@ -112,7 +112,7 @@ public function test_display_message_when_user_has_all_capabilities() { /** * Test zoom invitation display message for user with only the mod/zoom:viewjoinurl capability. */ - public function test_display_message_when_user_has_viewjoinurl_capability() { + public function test_display_message_when_user_has_viewjoinurl_capability(): void { $this->resetAfterTest(); $this->setAdminUser(); $user = $this->getDataGenerator()->create_user(); @@ -140,7 +140,7 @@ public function test_display_message_when_user_has_viewjoinurl_capability() { /** * Test zoom invitation display message for user with only the mod/zoom:viewdialin capability. */ - public function test_display_message_when_user_has_viewdialin_capability() { + public function test_display_message_when_user_has_viewdialin_capability(): void { $this->resetAfterTest(); $this->setAdminUser(); $user = $this->getDataGenerator()->create_user(); @@ -197,7 +197,7 @@ public function test_display_message_when_user_has_viewdialin_capability() { /** * Test zoom invitation display message for user has no capabilities. */ - public function test_display_message_when_user_has_no_capabilities() { + public function test_display_message_when_user_has_no_capabilities(): void { $this->resetAfterTest(); $this->setAdminUser(); $user = $this->getDataGenerator()->create_user(); @@ -218,7 +218,7 @@ public function test_display_message_when_user_has_no_capabilities() { /** * Test message if regex pattern is intentionally set to empty for an element. */ - public function test_display_message_when_a_regex_pattern_is_empty() { + public function test_display_message_when_a_regex_pattern_is_empty(): void { global $PAGE; $this->resetAfterTest(); $this->setAdminUser(); @@ -239,7 +239,7 @@ public function test_display_message_when_a_regex_pattern_is_empty() { /** * Test debug message if regex pattern is not valid for an element. */ - public function test_display_message_when_a_regex_pattern_is_invalid() { + public function test_display_message_when_a_regex_pattern_is_invalid(): void { global $PAGE; $this->resetAfterTest(); $this->setAdminUser(); @@ -260,7 +260,7 @@ public function test_display_message_when_a_regex_pattern_is_invalid() { /** * Test debug message if no match is found using regex pattern for an element. */ - public function test_display_message_when_a_regex_pattern_is_finds_no_match() { + public function test_display_message_when_a_regex_pattern_is_finds_no_match(): void { $this->resetAfterTest(); $this->setAdminUser(); set_config('invitation_joinurl', '/nomatch/mi', 'zoom'); @@ -278,7 +278,7 @@ public function test_display_message_when_a_regex_pattern_is_finds_no_match() { /** * Test removing the invite sentence from the zoom meeting message. */ - public function test_display_message_has_invite_removed_if_setting_enabled() { + public function test_display_message_has_invite_removed_if_setting_enabled(): void { $this->resetAfterTest(); $this->setAdminUser(); set_config('invitationremoveinvite', '1', 'zoom'); @@ -336,7 +336,7 @@ public function test_display_message_has_invite_removed_if_setting_enabled() { /** * Test not removing the invite sentence from the zoom meeting message. */ - public function test_display_message_does_not_have_invite_removed_if_setting_disabled() { + public function test_display_message_does_not_have_invite_removed_if_setting_disabled(): void { $this->resetAfterTest(); $this->setAdminUser(); set_config('invitationremoveinvite', '0', 'zoom'); @@ -396,7 +396,7 @@ public function test_display_message_does_not_have_invite_removed_if_setting_dis /** * Test removing the iCal link from the zoom meeting message. */ - public function test_display_message_has_icallink_removed_if_setting_enabled() { + public function test_display_message_has_icallink_removed_if_setting_enabled(): void { $this->resetAfterTest(); $this->setAdminUser(); set_config('invitationremoveicallink', '1', 'zoom'); @@ -569,7 +569,7 @@ public function test_display_message_has_icallink_removed_if_setting_enabled() { /** * Test not removing the iCal link from the zoom meeting message. */ - public function test_display_message_does_not_have_icallink_removed_if_setting_disabled() { + public function test_display_message_does_not_have_icallink_removed_if_setting_disabled(): void { $this->resetAfterTest(); $this->setAdminUser(); set_config('invitationremoveicallink', '0', 'zoom'); @@ -738,7 +738,7 @@ public function test_display_message_does_not_have_icallink_removed_if_setting_d /** * Test get_display_string returns null without throwing an error if the invitation string provided is null. */ - public function test_display_message_when_instantiated_with_null_zoom_meeting_invitation() { + public function test_display_message_when_instantiated_with_null_zoom_meeting_invitation(): void { $this->resetAfterTest(); $this->setAdminUser(); $course = $this->getDataGenerator()->create_course(); @@ -750,7 +750,7 @@ public function test_display_message_when_instantiated_with_null_zoom_meeting_in /** * Test display message is returned in full regardless of capabilities if regex patterns are disabled. */ - public function test_display_message_when_user_has_no_capabilities_with_regex_disabled() { + public function test_display_message_when_user_has_no_capabilities_with_regex_disabled(): void { set_config('invitationregexenabled', 0, 'zoom'); $this->resetAfterTest(); $this->setAdminUser(); diff --git a/tests/mod_zoom_webservice_test.php b/tests/mod_zoom_webservice_test.php index 3b687503..1f551931 100644 --- a/tests/mod_zoom_webservice_test.php +++ b/tests/mod_zoom_webservice_test.php @@ -85,7 +85,7 @@ public function get_info() { /** * Tests that uuid are encoded properly for use in web service calls. */ - public function test_encode_uuid() { + public function test_encode_uuid(): void { $service = zoom_webservice(); // If uuid includes / or // it needs to be double encoded. @@ -103,7 +103,7 @@ public function test_encode_uuid() { /** * Tests whether the meeting not found errors are properly parsed. */ - public function test_meeting_not_found_exception() { + public function test_meeting_not_found_exception(): void { $mockservice = $this->getMockBuilder('\mod_zoom\webservice') ->setMethods(['make_curl_call', 'get_curl_object', 'get_access_token']) ->getMock(); @@ -135,7 +135,7 @@ public function test_meeting_not_found_exception() { /** * Tests whether user not found errors are properly parsed. */ - public function test_user_not_found_exception() { + public function test_user_not_found_exception(): void { $mockservice = $this->getMockBuilder('\mod_zoom\webservice') ->setMethods(['make_curl_call', 'get_curl_object', 'get_access_token']) ->getMock(); @@ -168,7 +168,7 @@ public function test_user_not_found_exception() { /** * Tests whether invalid user errors are parsed properly */ - public function test_invalid_user_exception() { + public function test_invalid_user_exception(): void { $invalidmockcurl = new class { // @codingStandardsIgnoreStart /** @@ -229,7 +229,7 @@ public function get_info() { * Tests whether the retry on a 429 works properly when the Retry-After header * is in the curl response to specify the time that the retry should be sent. */ - public function test_retry_with_header() { + public function test_retry_with_header(): void { $retrywithheadermockcurl = new class { public $numgetinfocalls = 0; // @codingStandardsIgnoreStart @@ -308,7 +308,7 @@ public function getResponse() { * Tests whether the retry on a 429 response works when the Retry-After * header is not sent in the curl response. */ - public function test_retry_without_header() { + public function test_retry_without_header(): void { $retrynoheadermockcurl = new class { public $numgetinfocalls = 0; // @codingStandardsIgnoreStart @@ -376,7 +376,7 @@ public function getResponse() { /** * Tests that we throw error if we tried more than max retries. */ - public function test_retry_exception() { + public function test_retry_exception(): void { $retryfailuremockcurl = new class { public $urlpath = null; // @codingStandardsIgnoreStart @@ -463,7 +463,7 @@ public function getResponse() { /** * Tests that we are waiting 1 minute for QPS rate limit types. */ - public function test_retryqps_exception() { + public function test_retryqps_exception(): void { $retryqpsmockcurl = new class { public $urlpath = null; // @codingStandardsIgnoreStart diff --git a/tests/privacy/mod_zoom_provider_test.php b/tests/privacy/mod_zoom_provider_test.php index f643611a..08d79dd7 100644 --- a/tests/privacy/mod_zoom_provider_test.php +++ b/tests/privacy/mod_zoom_provider_test.php @@ -146,7 +146,7 @@ protected function setUp(): void { * Test for provider::get_metadata(). * @covers ::get_metadata */ - public function test_get_metadata() { + public function test_get_metadata(): void { $collection = new collection('mod_zoom'); $newcollection = provider::get_metadata($collection); $itemcollection = $newcollection->get_collection(); @@ -190,7 +190,7 @@ public function test_get_metadata() { * Test for provider::get_contexts_for_userid(). * @covers ::get_contexts_for_userid */ - public function test_get_contexts_for_userid() { + public function test_get_contexts_for_userid(): void { $contextlist = provider::get_contexts_for_userid($this->student->id); $this->assertCount(1, $contextlist); $contextforuser = $contextlist->current(); @@ -208,7 +208,7 @@ public function test_get_contexts_for_userid() { * Test for provider::get_users_in_context(). * @covers ::get_users_in_context */ - public function test_get_users_in_context() { + public function test_get_users_in_context(): void { $cmcontext = context_module::instance($this->cm->id); $userlist = new userlist($cmcontext, 'mod_zoom'); @@ -221,7 +221,7 @@ public function test_get_users_in_context() { * Test for provider::export_user_data(). * @covers ::export_user_data */ - public function test_export_user_data() { + public function test_export_user_data(): void { $cmcontext = context_module::instance($this->cm->id); // Export all of the data for the context. @@ -234,7 +234,7 @@ public function test_export_user_data() { * Test for provider::delete_data_for_all_users_in_context(). * @covers ::delete_data_for_all_users_in_context */ - public function test_delete_data_for_all_users_in_context() { + public function test_delete_data_for_all_users_in_context(): void { global $DB; $zoommeetingcount = $DB->count_records('zoom_meeting_details'); @@ -270,7 +270,7 @@ public function test_delete_data_for_all_users_in_context() { * Test for provider::delete_data_for_user(). * @covers ::delete_data_for_user */ - public function test_delete_data_for_user() { + public function test_delete_data_for_user(): void { global $DB; $zmparticipants = $DB->count_records('zoom_meeting_participants'); @@ -295,7 +295,7 @@ public function test_delete_data_for_user() { * Test for provider::delete_data_for_users(). * @covers ::delete_data_for_users */ - public function test_delete_data_for_users() { + public function test_delete_data_for_users(): void { global $DB; $zmparticipants = $DB->count_records('zoom_meeting_participants');