From 091b458c52de1037652e618b93a8594daf78a07a Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Thu, 30 May 2024 12:15:15 +0200 Subject: [PATCH] MDL-81522 phpunit: Add missing void return type to all tests #2 This commit includes more changes, all them also adding the :void return type to unit tests missing them. The difference is that all these changes, while also detected perfectly by the moodle.PHPUnit.TestReturnType sniff, were not auto-fixed (like the previous commit ones), because all them do include some "return" statement and, for safety, we don't fix them. All the cases have been visually inspected and confirmed that the existing "return" statements always belong to anon functions within the test body and not the test own return statement. --- .../tests/expired_contexts_test.php | 8 +++---- .../tests/manager_observer_test.php | 2 +- .../generator/tests/maketestcourse_test.php | 2 +- admin/tool/policy/tests/api_test.php | 2 +- cache/tests/administration_helper_test.php | 2 +- calendar/tests/event_factory_test.php | 10 ++++---- calendar/tests/event_vault_test.php | 12 +++++----- calendar/tests/externallib_test.php | 4 ++-- calendar/tests/std_proxy_test.php | 8 +++---- competency/tests/privacy/provider_test.php | 2 +- course/tests/backup/restore_test.php | 2 +- ..._content_item_readonly_repository_test.php | 2 +- course/tests/category_test.php | 2 +- .../content_item_readonly_repository_test.php | 2 +- course/tests/courselib_test.php | 14 +++++------ course/tests/externallib_test.php | 8 +++---- .../published_resource_repository_test.php | 4 ++-- .../resource_link_repository_test.php | 4 ++-- .../ltiadvantage/task/sync_members_test.php | 2 +- .../task/sync_tool_grades_test.php | 6 ++--- enrol/tests/enrollib_test.php | 2 +- lib/dml/tests/dml_test.php | 2 +- lib/filebrowser/tests/file_browser_test.php | 10 ++++---- lib/filestorage/tests/file_storage_test.php | 2 +- lib/form/tests/filetypes_util_test.php | 2 +- lib/phpunit/tests/phpunit_dataset_test.php | 2 +- lib/tests/authlib_test.php | 2 +- lib/tests/core_media_player_native_test.php | 2 +- lib/tests/curl_security_helper_test.php | 2 +- lib/tests/grouplib_test.php | 2 +- lib/tests/navigation/output/primary_test.php | 2 +- .../mustache_helper_collection_test.php | 2 +- lib/tests/questionlib_test.php | 2 +- lib/tests/task/database_logger_test.php | 2 +- login/tests/login_lib_test.php | 2 +- media/player/html5audio/tests/player_test.php | 2 +- media/player/html5video/tests/player_test.php | 2 +- message/tests/api_test.php | 6 ++--- message/tests/externallib_test.php | 10 ++++---- message/tests/privacy/provider_test.php | 10 ++++---- .../tests/external/start_submission_test.php | 10 ++++---- mod/assign/tests/externallib_test.php | 2 +- mod/assign/tests/lib_test.php | 2 +- .../tests/external/get_recordings_test.php | 2 +- mod/bigbluebuttonbn/tests/lib_test.php | 4 ++-- .../local/proxy/recording_proxy_test.php | 4 ++-- .../output/recording_row_playback_test.php | 2 +- mod/choice/tests/lib_test.php | 4 ++-- mod/data/tests/lib_test.php | 4 ++-- mod/data/tests/manager_test.php | 6 ++--- mod/data/tests/preset_test.php | 2 +- mod/feedback/tests/lib_test.php | 2 +- .../tests/builders_exported_posts_test.php | 12 +++++----- mod/forum/tests/entities_sorter_test.php | 4 ++-- mod/forum/tests/privacy/provider_test.php | 6 ++--- mod/forum/tests/vaults_forum_test.php | 2 +- .../get_h5pactivities_by_courses_test.php | 2 +- mod/lesson/tests/lib_test.php | 4 ++-- .../tests/calendar_event_modified_test.php | 2 +- .../local_structure_slot_random_test.php | 2 +- mod/scorm/tests/externallib_test.php | 2 +- mod/scorm/tests/lib_test.php | 4 ++-- mod/wiki/tests/privacy/provider_test.php | 8 +++---- privacy/tests/moodle_content_writer_test.php | 4 ++-- question/tests/externallib_test.php | 4 ++-- .../calculated/tests/question_type_test.php | 2 +- .../multianswer/tests/question_type_test.php | 2 +- .../contentbank/tests/search/search_test.php | 2 +- repository/dropbox/tests/api_test.php | 6 ++--- tag/tests/privacy/provider_test.php | 2 +- tag/tests/taglib_test.php | 24 +++++++++---------- user/tests/userlib_test.php | 2 +- 72 files changed, 153 insertions(+), 153 deletions(-) diff --git a/admin/tool/dataprivacy/tests/expired_contexts_test.php b/admin/tool/dataprivacy/tests/expired_contexts_test.php index 4b8680c4d7a..d851000ba6a 100644 --- a/admin/tool/dataprivacy/tests/expired_contexts_test.php +++ b/admin/tool/dataprivacy/tests/expired_contexts_test.php @@ -867,7 +867,7 @@ class expired_contexts_test extends \advanced_testcase { /** * Ensure that a module context previously flagged as approved is removed with appropriate unexpiredroles kept. */ - public function test_process_course_context_with_override_unexpired_role() { + public function test_process_course_context_with_override_unexpired_role(): void { global $DB; $this->resetAfterTest(); @@ -955,7 +955,7 @@ class expired_contexts_test extends \advanced_testcase { /** * Ensure that a module context previously flagged as approved is removed with appropriate expiredroles kept. */ - public function test_process_course_context_with_override_expired_role() { + public function test_process_course_context_with_override_expired_role(): void { global $DB; $this->resetAfterTest(); @@ -1043,7 +1043,7 @@ class expired_contexts_test extends \advanced_testcase { /** * Ensure that a module context previously flagged as approved is removed with appropriate expiredroles kept. */ - public function test_process_course_context_with_user_in_both_lists() { + public function test_process_course_context_with_user_in_both_lists(): void { global $DB; $this->resetAfterTest(); @@ -1132,7 +1132,7 @@ class expired_contexts_test extends \advanced_testcase { /** * Ensure that a module context previously flagged as approved is removed with appropriate expiredroles kept. */ - public function test_process_course_context_with_user_in_both_lists_expired() { + public function test_process_course_context_with_user_in_both_lists_expired(): void { global $DB; $this->resetAfterTest(); diff --git a/admin/tool/dataprivacy/tests/manager_observer_test.php b/admin/tool/dataprivacy/tests/manager_observer_test.php index 7296eb181d1..4902dcd2c84 100644 --- a/admin/tool/dataprivacy/tests/manager_observer_test.php +++ b/admin/tool/dataprivacy/tests/manager_observer_test.php @@ -32,7 +32,7 @@ class manager_observer_test extends data_privacy_testcase { /** * Ensure that when users are configured as DPO, they are sent an message upon failure. */ - public function test_handle_component_failure() { + public function test_handle_component_failure(): void { $this->resetAfterTest(); // Create another user who is not a DPO. diff --git a/admin/tool/generator/tests/maketestcourse_test.php b/admin/tool/generator/tests/maketestcourse_test.php index a257a42262c..11670ec10f1 100644 --- a/admin/tool/generator/tests/maketestcourse_test.php +++ b/admin/tool/generator/tests/maketestcourse_test.php @@ -30,7 +30,7 @@ class maketestcourse_test extends \advanced_testcase { /** * Creates a small test course and checks all the components have been put in place. */ - public function test_make_xs_course() { + public function test_make_xs_course(): void { global $DB; $this->resetAfterTest(); diff --git a/admin/tool/policy/tests/api_test.php b/admin/tool/policy/tests/api_test.php index 7a7605a23e6..ee4973f2b3b 100644 --- a/admin/tool/policy/tests/api_test.php +++ b/admin/tool/policy/tests/api_test.php @@ -193,7 +193,7 @@ class api_test extends \advanced_testcase { /** * Test that list of policies can be filtered by audience */ - public function test_list_policies_audience() { + public function test_list_policies_audience(): void { $this->resetAfterTest(); $this->setAdminUser(); diff --git a/cache/tests/administration_helper_test.php b/cache/tests/administration_helper_test.php index b61cc087a8a..49b3dd1a06f 100644 --- a/cache/tests/administration_helper_test.php +++ b/cache/tests/administration_helper_test.php @@ -60,7 +60,7 @@ class administration_helper_test extends \advanced_testcase { /** * Test the numerous summaries the helper can produce. */ - public function test_get_summaries() { + public function test_get_summaries(): void { // First the preparation. $config = cache_config_writer::instance(); $this->assertTrue($config->add_store_instance('summariesstore', 'file')); diff --git a/calendar/tests/event_factory_test.php b/calendar/tests/event_factory_test.php index 3fabf8e8559..b571aa7ea90 100644 --- a/calendar/tests/event_factory_test.php +++ b/calendar/tests/event_factory_test.php @@ -85,7 +85,7 @@ class event_factory_test extends \advanced_testcase { /** * Test invalid callback exception. */ - public function test_invalid_action_callback() { + public function test_invalid_action_callback(): void { $this->resetAfterTest(true); $this->setAdminUser(); $event = $this->create_event(); @@ -135,7 +135,7 @@ class event_factory_test extends \advanced_testcase { /** * Test invalid callback exception. */ - public function test_invalid_visibility_callback() { + public function test_invalid_visibility_callback(): void { $this->resetAfterTest(true); $this->setAdminUser(); $event = $this->create_event(); @@ -185,7 +185,7 @@ class event_factory_test extends \advanced_testcase { /** * Test invalid callback exception. */ - public function test_invalid_bail_callback() { + public function test_invalid_bail_callback(): void { $this->resetAfterTest(true); $this->setAdminUser(); $event = $this->create_event(); @@ -235,7 +235,7 @@ class event_factory_test extends \advanced_testcase { /** * Test the factory's course cache. */ - public function test_course_cache() { + public function test_course_cache(): void { $this->resetAfterTest(true); $this->setAdminUser(); $course = self::getDataGenerator()->create_course(); @@ -288,7 +288,7 @@ class event_factory_test extends \advanced_testcase { /** * Test the factory's module cache. */ - public function test_module_cache() { + public function test_module_cache(): void { $this->resetAfterTest(true); $this->setAdminUser(); $course = self::getDataGenerator()->create_course(); diff --git a/calendar/tests/event_vault_test.php b/calendar/tests/event_vault_test.php index d03ab45ea80..c8c29368325 100644 --- a/calendar/tests/event_vault_test.php +++ b/calendar/tests/event_vault_test.php @@ -196,7 +196,7 @@ class event_vault_test extends \advanced_testcase { * provided timesort values and the last seen event can be provided to * get paginated results. */ - public function test_get_action_events_by_timesort_between_time_skip_even_records() { + public function test_get_action_events_by_timesort_between_time_skip_even_records(): void { $this->resetAfterTest(true); $this->setAdminuser(); @@ -247,7 +247,7 @@ class event_vault_test extends \advanced_testcase { * number of events requested has been satisfied. In this case the first * five events are rejected so it should require two database requests. */ - public function test_get_action_events_by_timesort_between_time_skip_first_records() { + public function test_get_action_events_by_timesort_between_time_skip_first_records(): void { $this->resetAfterTest(true); $this->setAdminuser(); @@ -423,7 +423,7 @@ class event_vault_test extends \advanced_testcase { * - A user in group B should see only the B override * - A user in both A and B should see both */ - public function test_get_action_events_by_timesort_with_identical_group_override_priorities() { + public function test_get_action_events_by_timesort_with_identical_group_override_priorities(): void { $this->resetAfterTest(); $this->setAdminuser(); @@ -804,7 +804,7 @@ class event_vault_test extends \advanced_testcase { * provided timesort values and the last seen event can be provided to * get paginated results. */ - public function test_get_action_events_by_course_between_time_skip_even_records() { + public function test_get_action_events_by_course_between_time_skip_even_records(): void { $user = $this->getDataGenerator()->create_user(); $course1 = $this->getDataGenerator()->create_course(); $course2 = $this->getDataGenerator()->create_course(); @@ -870,7 +870,7 @@ class event_vault_test extends \advanced_testcase { * number of events requested has been satisfied. In this case the first * five events are rejected so it should require two database requests. */ - public function test_get_action_events_by_course_between_time_skip_first_records() { + public function test_get_action_events_by_course_between_time_skip_first_records(): void { $user = $this->getDataGenerator()->create_user(); $course1 = $this->getDataGenerator()->create_course(); $course2 = $this->getDataGenerator()->create_course(); @@ -1080,7 +1080,7 @@ class event_vault_test extends \advanced_testcase { * - A user in group B should see only the B override * - A user in both A and B should see both */ - public function test_get_action_events_by_course_with_identical_group_override_priorities() { + public function test_get_action_events_by_course_with_identical_group_override_priorities(): void { $this->resetAfterTest(); $this->setAdminuser(); diff --git a/calendar/tests/externallib_test.php b/calendar/tests/externallib_test.php index 33ee8a22d90..e987aaa7eac 100644 --- a/calendar/tests/externallib_test.php +++ b/calendar/tests/externallib_test.php @@ -1425,7 +1425,7 @@ class externallib_test extends externallib_advanced_testcase { * Test that get_action_events_by_courses will return a list of events for each * course you provided as long as the user is enrolled in the course. */ - public function test_get_action_events_by_courses() { + public function test_get_action_events_by_courses(): void { $user = $this->getDataGenerator()->create_user(); $course1 = $this->getDataGenerator()->create_course(); $course2 = $this->getDataGenerator()->create_course(); @@ -1558,7 +1558,7 @@ class externallib_test extends externallib_advanced_testcase { /** * Test get_action_events_by_courses with search feature */ - public function test_get_action_events_by_courses_with_search() { + public function test_get_action_events_by_courses_with_search(): void { // Generate data. $user = $this->getDataGenerator()->create_user(); $course1 = $this->getDataGenerator()->create_course(); diff --git a/calendar/tests/std_proxy_test.php b/calendar/tests/std_proxy_test.php index 9658a6098fa..af3080df979 100644 --- a/calendar/tests/std_proxy_test.php +++ b/calendar/tests/std_proxy_test.php @@ -54,7 +54,7 @@ class std_proxy_test extends \advanced_testcase { * @param string $member Object member to retrieve. * @param mixed $expected Expected value of member. */ - public function test_proxy($id, $member, $expected) { + public function test_proxy($id, $member, $expected): void { $proxy = new std_proxy($id, function($id) { return $this->objects[$id]; }); @@ -70,7 +70,7 @@ class std_proxy_test extends \advanced_testcase { * @param string $member Object member to retrieve. * @param mixed $storedvalue Value as would be stored externally. */ - public function test_base_values($id, $member, $storedvalue) { + public function test_base_values($id, $member, $storedvalue): void { $proxy = new std_proxy( $id, function($id) { @@ -89,7 +89,7 @@ class std_proxy_test extends \advanced_testcase { * @dataProvider get_set_testcases * @param int $id ID of the object being proxied. */ - public function test_get_invalid_member($id) { + public function test_get_invalid_member($id): void { $proxy = new std_proxy($id, function($id) { return $this->objects[$id]; }); @@ -104,7 +104,7 @@ class std_proxy_test extends \advanced_testcase { * @dataProvider get_set_testcases * @param int $id Object ID. */ - public function test_get_proxied_instance($id) { + public function test_get_proxied_instance($id): void { $proxy = new std_proxy($id, function($id) { return $this->objects[$id]; }); diff --git a/competency/tests/privacy/provider_test.php b/competency/tests/privacy/provider_test.php index 2e8f39aa8ea..dff9fe5cf1d 100644 --- a/competency/tests/privacy/provider_test.php +++ b/competency/tests/privacy/provider_test.php @@ -1999,7 +1999,7 @@ class provider_test extends provider_testcase { $this->assert_exported_comments(['Hi.'], $data->comments); } - public function test_export_data_for_user_with_related_competencies() { + public function test_export_data_for_user_with_related_competencies(): void { $path = [ get_string('competencies', 'core_competency'), get_string('privacy:path:relatedtome', 'core_competency'), diff --git a/course/tests/backup/restore_test.php b/course/tests/backup/restore_test.php index 26ebb90dc31..bfd98f5752b 100644 --- a/course/tests/backup/restore_test.php +++ b/course/tests/backup/restore_test.php @@ -387,7 +387,7 @@ class restore_test extends \advanced_testcase { $this->assertEquals($startdate, $c2->startdate); } - public function test_restore_course_with_users() { + public function test_restore_course_with_users(): void { global $DB; $this->resetAfterTest(); $this->setAdminUser(); diff --git a/course/tests/caching_content_item_readonly_repository_test.php b/course/tests/caching_content_item_readonly_repository_test.php index ffb76c63901..9ea96b426f4 100644 --- a/course/tests/caching_content_item_readonly_repository_test.php +++ b/course/tests/caching_content_item_readonly_repository_test.php @@ -39,7 +39,7 @@ class caching_content_item_readonly_repository_test extends \advanced_testcase { /** * Test verifying that content items are cached and returned from the cache in subsequent same-request calls. */ - public function test_find_all_for_course() { + public function test_find_all_for_course(): void { $this->resetAfterTest(); global $DB; diff --git a/course/tests/category_test.php b/course/tests/category_test.php index c1ec14a6997..f17709fce11 100644 --- a/course/tests/category_test.php +++ b/course/tests/category_test.php @@ -751,7 +751,7 @@ class category_test extends \advanced_testcase { $CFG->coursecontact = $oldcoursecontact; } - public function test_course_contacts_with_duplicates() { + public function test_course_contacts_with_duplicates(): void { global $DB, $CFG; set_config('coursecontactduplicates', true); diff --git a/course/tests/content_item_readonly_repository_test.php b/course/tests/content_item_readonly_repository_test.php index 84406076c09..8a6b30aff56 100644 --- a/course/tests/content_item_readonly_repository_test.php +++ b/course/tests/content_item_readonly_repository_test.php @@ -76,7 +76,7 @@ class content_item_readonly_repository_test extends \advanced_testcase { /** * Test confirming that all content items can be fetched, even those which require certain caps when in a course. */ - public function test_find_all() { + public function test_find_all(): void { $this->resetAfterTest(); global $DB, $CFG; diff --git a/course/tests/courselib_test.php b/course/tests/courselib_test.php index 7fdaf62202f..45338180d38 100644 --- a/course/tests/courselib_test.php +++ b/course/tests/courselib_test.php @@ -4582,7 +4582,7 @@ class courselib_test extends advanced_testcase { * @param array $coursesdata Courses to create * @param array $expected Expected test results. */ - public function test_course_classify_courses_for_timeline($coursesdata, $expected) { + public function test_course_classify_courses_for_timeline($coursesdata, $expected): void { $this->resetAfterTest(); $generator = $this->getDataGenerator(); @@ -4723,7 +4723,7 @@ class courselib_test extends advanced_testcase { $offset, $expecteddbqueries, $expectedresult - ) { + ): void { global $DB; $this->resetAfterTest(); @@ -4908,7 +4908,7 @@ class courselib_test extends advanced_testcase { /** * Test the course_get_enrolled_courses_for_logged_in_user_from_search function. */ - public function test_course_get_enrolled_courses_for_logged_in_user_from_search() { + public function test_course_get_enrolled_courses_for_logged_in_user_from_search(): void { global $DB; // Set up. @@ -5021,7 +5021,7 @@ class courselib_test extends advanced_testcase { $offset, $expectedcourses, $expectedprocessedcount - ) { + ): void { $this->resetAfterTest(); $generator = $this->getDataGenerator(); @@ -5242,7 +5242,7 @@ class courselib_test extends advanced_testcase { $offset, $expectedcourses, $expectedprocessedcount - ) { + ): void { $this->resetAfterTest(); $generator = $this->getDataGenerator(); @@ -5487,7 +5487,7 @@ class courselib_test extends advanced_testcase { $expectedcourses, $expectedprocessedcount, $hiddencourse - ) { + ): void { $this->resetAfterTest(); $generator = $this->getDataGenerator(); $student = $generator->create_user(); @@ -6983,7 +6983,7 @@ class courselib_test extends advanced_testcase { $enrolmentmethods, $enrolled, $expected - ) { + ): void { global $DB; $this->resetAfterTest(); diff --git a/course/tests/externallib_test.php b/course/tests/externallib_test.php index a560bf98674..606af80929c 100644 --- a/course/tests/externallib_test.php +++ b/course/tests/externallib_test.php @@ -3747,7 +3747,7 @@ class externallib_test extends externallib_advanced_testcase { $expectednextoffset, $expectedexception = null, $searchvalue = null - ) { + ): void { $this->resetAfterTest(); $generator = $this->getDataGenerator(); @@ -3979,7 +3979,7 @@ class externallib_test extends externallib_advanced_testcase { /** * Verify that content items can be added to user favourites. */ - public function test_add_content_item_to_user_favourites() { + public function test_add_content_item_to_user_favourites(): void { $this->resetAfterTest(); $course = $this->getDataGenerator()->create_course(); @@ -4017,7 +4017,7 @@ class externallib_test extends externallib_advanced_testcase { /** * Verify that content items can be removed from user favourites. */ - public function test_remove_content_item_from_user_favourites() { + public function test_remove_content_item_from_user_favourites(): void { $this->resetAfterTest(); $course = $this->getDataGenerator()->create_course(); @@ -4057,7 +4057,7 @@ class externallib_test extends externallib_advanced_testcase { /** * Test the web service returning course content items for inclusion in activity choosers, etc. */ - public function test_get_course_content_items() { + public function test_get_course_content_items(): void { $this->resetAfterTest(); $course = self::getDataGenerator()->create_course(); diff --git a/enrol/lti/tests/local/ltiadvantage/repository/published_resource_repository_test.php b/enrol/lti/tests/local/ltiadvantage/repository/published_resource_repository_test.php index 58bc5635d68..9a9baac241b 100644 --- a/enrol/lti/tests/local/ltiadvantage/repository/published_resource_repository_test.php +++ b/enrol/lti/tests/local/ltiadvantage/repository/published_resource_repository_test.php @@ -98,7 +98,7 @@ class published_resource_repository_test extends \advanced_testcase { * * @covers ::find_all_for_user */ - public function test_find_all_for_user() { + public function test_find_all_for_user(): void { $this->resetAfterTest(); [$user, $user2, $user3, $course, $course2, $mod, $mod2, $mod3, $mod4] = $this->generate_published_resources(); @@ -131,7 +131,7 @@ class published_resource_repository_test extends \advanced_testcase { * * @covers ::find_all_by_ids_for_user */ - public function test_find_all_by_ids_for_user() { + public function test_find_all_by_ids_for_user(): void { $this->resetAfterTest(); [$user, $user2, $user3, $course, $course2, $mod, $mod2, $mod3, $mod4, $coursetool, $tool, $tool2, $tool3, $tool4] = $this->generate_published_resources(); diff --git a/enrol/lti/tests/local/ltiadvantage/repository/resource_link_repository_test.php b/enrol/lti/tests/local/ltiadvantage/repository/resource_link_repository_test.php index 4526cb3ab3f..7d69fdb4121 100644 --- a/enrol/lti/tests/local/ltiadvantage/repository/resource_link_repository_test.php +++ b/enrol/lti/tests/local/ltiadvantage/repository/resource_link_repository_test.php @@ -167,7 +167,7 @@ class resource_link_repository_test extends \advanced_testcase { * * @covers ::find_by_resource */ - public function test_find_by_resource() { + public function test_find_by_resource(): void { $this->resetAfterTest(); $resourcelink = $this->generate_resource_link(); $repository = new resource_link_repository(); @@ -196,7 +196,7 @@ class resource_link_repository_test extends \advanced_testcase { * * @covers ::find_by_resource_and_user */ - public function test_find_by_resource_and_user() { + public function test_find_by_resource_and_user(): void { global $CFG; $this->resetAfterTest(); $resourcelink = $this->generate_resource_link(); diff --git a/enrol/lti/tests/local/ltiadvantage/task/sync_members_test.php b/enrol/lti/tests/local/ltiadvantage/task/sync_members_test.php index 3db54e83d4a..eccca4c6009 100644 --- a/enrol/lti/tests/local/ltiadvantage/task/sync_members_test.php +++ b/enrol/lti/tests/local/ltiadvantage/task/sync_members_test.php @@ -726,7 +726,7 @@ class sync_members_test extends \lti_advantage_testcase { * @covers ::execute */ public function test_sync_enrolments_and_migration(?array $legacydata, ?array $resourceconfig, array $launchdata, - ?array $syncmembers, array $expected) { + ?array $syncmembers, array $expected): void { $this->resetAfterTest(); diff --git a/enrol/lti/tests/local/ltiadvantage/task/sync_tool_grades_test.php b/enrol/lti/tests/local/ltiadvantage/task/sync_tool_grades_test.php index f661e03ab08..72b95b813ba 100644 --- a/enrol/lti/tests/local/ltiadvantage/task/sync_tool_grades_test.php +++ b/enrol/lti/tests/local/ltiadvantage/task/sync_tool_grades_test.php @@ -743,7 +743,7 @@ class sync_tool_grades_test extends \lti_advantage_testcase { * * @covers ::execute */ - public function test_sync_grades_coupled_lineitem() { + public function test_sync_grades_coupled_lineitem(): void { $this->resetAfterTest(); [$course, $resource] = $this->create_test_environment(); @@ -817,7 +817,7 @@ class sync_tool_grades_test extends \lti_advantage_testcase { * * @covers ::execute */ - public function test_sync_grades_none_or_many_lineitems_activity_context() { + public function test_sync_grades_none_or_many_lineitems_activity_context(): void { $this->resetAfterTest(); [$course, $resource] = $this->create_test_environment(); @@ -894,7 +894,7 @@ class sync_tool_grades_test extends \lti_advantage_testcase { * * @covers ::execute */ - public function test_sync_grades_none_or_many_lineitems_course_context() { + public function test_sync_grades_none_or_many_lineitems_course_context(): void { $this->resetAfterTest(); [$course, $tool1, $tool2, $resource] = $this->create_test_environment(); diff --git a/enrol/tests/enrollib_test.php b/enrol/tests/enrollib_test.php index 2280c144741..b19530f6726 100644 --- a/enrol/tests/enrollib_test.php +++ b/enrol/tests/enrollib_test.php @@ -1308,7 +1308,7 @@ class enrollib_test extends advanced_testcase { $limit, $offset, $expectedcourses - ) { + ): void { global $DB, $CFG; $this->resetAfterTest(); diff --git a/lib/dml/tests/dml_test.php b/lib/dml/tests/dml_test.php index b00b1f897db..f93189cc40c 100644 --- a/lib/dml/tests/dml_test.php +++ b/lib/dml/tests/dml_test.php @@ -533,7 +533,7 @@ EOD; * * @covers ::add_sql_debugging */ - public function test_sql_debugging_anon_class() { + public function test_sql_debugging_anon_class(): void { global $CFG; $CFG->debugsqltrace = 100; diff --git a/lib/filebrowser/tests/file_browser_test.php b/lib/filebrowser/tests/file_browser_test.php index 6d0123bbd07..5044a810b46 100644 --- a/lib/filebrowser/tests/file_browser_test.php +++ b/lib/filebrowser/tests/file_browser_test.php @@ -109,7 +109,7 @@ class file_browser_test extends \advanced_testcase { /** * Test "Server files" from the system context */ - public function test_file_info_context_system() { + public function test_file_info_context_system(): void { // There is one non-empty category child and two category children. @@ -126,7 +126,7 @@ class file_browser_test extends \advanced_testcase { /** * Test "Server files" from the system context, hide Misc category */ - public function test_file_info_context_system_hidden() { + public function test_file_info_context_system_hidden(): void { // Hide the course category that contains our two courses. Teacher does not have cap to view hidden categories. \core_course_category::get($this->course1->category)->update(['visible' => 0]); @@ -153,7 +153,7 @@ class file_browser_test extends \advanced_testcase { /** * Test "Server files" from the course category context */ - public function test_file_info_context_coursecat() { + public function test_file_info_context_coursecat(): void { // There are two non-empty courses. @@ -183,7 +183,7 @@ class file_browser_test extends \advanced_testcase { /** * Test "Server files" from the course context (course1) */ - public function test_file_info_context_course_1() { + public function test_file_info_context_course_1(): void { $browser = get_file_browser(); $fileinfo = $browser->get_file_info(\context_course::instance($this->course1->id)); @@ -214,7 +214,7 @@ class file_browser_test extends \advanced_testcase { /** * Test "Server files" from the course context (course1) */ - public function test_file_info_context_course_2() { + public function test_file_info_context_course_2(): void { // 2. Start from the course level. $browser = get_file_browser(); diff --git a/lib/filestorage/tests/file_storage_test.php b/lib/filestorage/tests/file_storage_test.php index d5acb1c931b..2c1500942b9 100644 --- a/lib/filestorage/tests/file_storage_test.php +++ b/lib/filestorage/tests/file_storage_test.php @@ -540,7 +540,7 @@ class file_storage_test extends \advanced_testcase { * * @covers ::get_area_files */ - public function test_get_area_files() { + public function test_get_area_files(): void { $user = $this->setup_three_private_files(); $fs = get_file_storage(); diff --git a/lib/form/tests/filetypes_util_test.php b/lib/form/tests/filetypes_util_test.php index d932964423f..f1cd3d5f7c7 100644 --- a/lib/form/tests/filetypes_util_test.php +++ b/lib/form/tests/filetypes_util_test.php @@ -273,7 +273,7 @@ class filetypes_util_test extends advanced_testcase { /** * Test populating the tree for the browser. */ - public function test_data_for_browser() { + public function test_data_for_browser(): void { $this->resetAfterTest(true); $util = new filetypes_util(); diff --git a/lib/phpunit/tests/phpunit_dataset_test.php b/lib/phpunit/tests/phpunit_dataset_test.php index c0c1cd64d6f..56dc9a29cc0 100644 --- a/lib/phpunit/tests/phpunit_dataset_test.php +++ b/lib/phpunit/tests/phpunit_dataset_test.php @@ -771,7 +771,7 @@ class phpunit_dataset_test extends advanced_testcase { * @dataProvider to_database_provider * @covers ::to_database */ - public function test_to_database(array $files, ?array $filter, ?string $exception, array $columns, array $rows) { + public function test_to_database(array $files, ?array $filter, ?string $exception, array $columns, array $rows): void { global $DB; $this->resetAfterTest(); diff --git a/lib/tests/authlib_test.php b/lib/tests/authlib_test.php index 1e02010f7ed..cb649428f1d 100644 --- a/lib/tests/authlib_test.php +++ b/lib/tests/authlib_test.php @@ -448,7 +448,7 @@ class authlib_test extends \advanced_testcase { /** * Test the {@link signup_validate_data()} duplicate email validation. */ - public function test_signup_validate_data_same_email() { + public function test_signup_validate_data_same_email(): void { global $CFG; require_once($CFG->libdir . '/authlib.php'); require_once($CFG->libdir . '/phpmailer/moodle_phpmailer.php'); diff --git a/lib/tests/core_media_player_native_test.php b/lib/tests/core_media_player_native_test.php index 6d563f47c20..5841c4bbbfe 100644 --- a/lib/tests/core_media_player_native_test.php +++ b/lib/tests/core_media_player_native_test.php @@ -58,7 +58,7 @@ class core_media_player_native_test extends \advanced_testcase { /** * Test method list_supported_urls */ - public function test_list_supported_urls() { + public function test_list_supported_urls(): void { global $CFG; require_once($CFG->libdir . '/filelib.php'); $nativeextensions = file_get_typegroup('extension', ['html_video', 'html_audio']); diff --git a/lib/tests/curl_security_helper_test.php b/lib/tests/curl_security_helper_test.php index 3d92e9f588b..568ff290d9f 100644 --- a/lib/tests/curl_security_helper_test.php +++ b/lib/tests/curl_security_helper_test.php @@ -37,7 +37,7 @@ class curl_security_helper_test extends \advanced_testcase { * @param bool $expected the expected result. * @dataProvider curl_security_url_data_provider */ - public function test_curl_security_helper_url_is_blocked($dns, $url, $blockedhosts, $allowedports, $expected) { + public function test_curl_security_helper_url_is_blocked($dns, $url, $blockedhosts, $allowedports, $expected): void { $this->resetAfterTest(true); $helper = $this->getMockBuilder('\core\files\curl_security_helper') ->onlyMethods(['get_host_list_by_name']) diff --git a/lib/tests/grouplib_test.php b/lib/tests/grouplib_test.php index ac363b42cc2..b76bf7f9e38 100644 --- a/lib/tests/grouplib_test.php +++ b/lib/tests/grouplib_test.php @@ -2050,7 +2050,7 @@ class grouplib_test extends \advanced_testcase { * * @covers \groups_get_my_groups() */ - public function test_get_my_groups_with_visibility() { + public function test_get_my_groups_with_visibility(): void { list($users, $groups) = $this->create_groups_with_visibilty(); // Assign users to groups. diff --git a/lib/tests/navigation/output/primary_test.php b/lib/tests/navigation/output/primary_test.php index 54e042c2ae1..25507be0066 100644 --- a/lib/tests/navigation/output/primary_test.php +++ b/lib/tests/navigation/output/primary_test.php @@ -54,7 +54,7 @@ class primary_test extends \advanced_testcase { * otherwise consider the user as non-logged in * @param array $expecteditems An array of nodes expected with content in them. */ - public function test_primary_export(bool $withcustom, bool $withlang, string $userloggedin, array $expecteditems) { + public function test_primary_export(bool $withcustom, bool $withlang, string $userloggedin, array $expecteditems): void { global $PAGE, $CFG; if ($withcustom) { $CFG->custommenuitems = "Course search|/course/search.php diff --git a/lib/tests/output/mustache_helper_collection_test.php b/lib/tests/output/mustache_helper_collection_test.php index 049225e907c..296bd0185ae 100644 --- a/lib/tests/output/mustache_helper_collection_test.php +++ b/lib/tests/output/mustache_helper_collection_test.php @@ -140,7 +140,7 @@ class mustache_helper_collection_test extends \advanced_testcase { * Any allowed helper should still be available to call during the * execution of a helper. */ - public function test_disallowed_helpers_disabled_during_execution() { + public function test_disallowed_helpers_disabled_during_execution(): void { $engine = new \Mustache_Engine(); $context = new \Mustache_Context(); $lambdahelper = new \Mustache_LambdaHelper($engine, $context); diff --git a/lib/tests/questionlib_test.php b/lib/tests/questionlib_test.php index d4a7e07273f..fa362c26221 100644 --- a/lib/tests/questionlib_test.php +++ b/lib/tests/questionlib_test.php @@ -695,7 +695,7 @@ class questionlib_test extends \advanced_testcase { * get_question_options includes the tags and course tags for all questions in the list * if each question has course and question level tags. */ - public function test_get_question_options_includes_question_and_course_tags() { + public function test_get_question_options_includes_question_and_course_tags(): void { list($category, $course, $quiz, $qcat, $questions) = $this->setup_quiz_and_questions('category'); $question1 = $questions[0]; $question2 = $questions[1]; diff --git a/lib/tests/task/database_logger_test.php b/lib/tests/task/database_logger_test.php index 1a0261332d4..80588bf2fd2 100644 --- a/lib/tests/task/database_logger_test.php +++ b/lib/tests/task/database_logger_test.php @@ -212,7 +212,7 @@ class database_logger_test extends \advanced_testcase { * @dataProvider delete_task_logs_provider * @param mixed $ids */ - public function test_delete_task_logs($ids) { + public function test_delete_task_logs($ids): void { $DB = $this->mock_database(); $DB->expects($this->once()) ->method('delete_records_list') diff --git a/login/tests/login_lib_test.php b/login/tests/login_lib_test.php index bdafdf7a1d9..2cab15a4174 100644 --- a/login/tests/login_lib_test.php +++ b/login/tests/login_lib_test.php @@ -383,7 +383,7 @@ class login_lib_test extends \advanced_testcase { * * Email addresses should be handled as case-insensitive but accent sensitive. */ - public function test_core_login_process_password_reset_email_sensitivity() { + public function test_core_login_process_password_reset_email_sensitivity(): void { global $CFG; require_once($CFG->libdir.'/phpmailer/moodle_phpmailer.php'); diff --git a/media/player/html5audio/tests/player_test.php b/media/player/html5audio/tests/player_test.php index da8bd005615..2650ab06905 100644 --- a/media/player/html5audio/tests/player_test.php +++ b/media/player/html5audio/tests/player_test.php @@ -70,7 +70,7 @@ class player_test extends \advanced_testcase { /** * Test method list_supported_urls() */ - public function test_list_supported_urls() { + public function test_list_supported_urls(): void { global $CFG; require_once($CFG->libdir . '/filelib.php'); diff --git a/media/player/html5video/tests/player_test.php b/media/player/html5video/tests/player_test.php index 66aaf731e5d..98ee415ca84 100644 --- a/media/player/html5video/tests/player_test.php +++ b/media/player/html5video/tests/player_test.php @@ -67,7 +67,7 @@ class player_test extends \advanced_testcase { /** * Test method list_supported_urls() */ - public function test_list_supported_urls() { + public function test_list_supported_urls(): void { global $CFG; require_once($CFG->libdir . '/filelib.php'); diff --git a/message/tests/api_test.php b/message/tests/api_test.php index cceae4fa663..b5801e8e492 100644 --- a/message/tests/api_test.php +++ b/message/tests/api_test.php @@ -1277,7 +1277,7 @@ class api_test extends messagelib_test { /** * Test verifying get_conversations identifies if a conversation is muted or not. */ - public function test_get_conversations_some_muted() { + public function test_get_conversations_some_muted(): void { // Create some users. $user1 = self::getDataGenerator()->create_user(); $user2 = self::getDataGenerator()->create_user(); @@ -5749,7 +5749,7 @@ class api_test extends messagelib_test { $expectedcounts, $expectedunreadcounts, $deletedusers - ) { + ): void { $generator = $this->getDataGenerator(); $users = [ $generator->create_user(), @@ -5872,7 +5872,7 @@ class api_test extends messagelib_test { $expectedcounts, $expectedunreadcounts, $deletedusers - ) { + ): void { $this->resetAfterTest(); $generator = $this->getDataGenerator(); $users = [ diff --git a/message/tests/externallib_test.php b/message/tests/externallib_test.php index a4b6f7f72fe..6769c630c8a 100644 --- a/message/tests/externallib_test.php +++ b/message/tests/externallib_test.php @@ -2032,7 +2032,7 @@ class externallib_test extends externallib_advanced_testcase { * If checks this by placing some users in the same course, where default caps would permit a user to view another user's * profile. */ - public function test_message_search_users_messagingallusers_disabled() { + public function test_message_search_users_messagingallusers_disabled(): void { global $DB; $this->resetAfterTest(); @@ -2128,7 +2128,7 @@ class externallib_test extends externallib_advanced_testcase { * This test verifies that any contacts are returned, as well as any non-contacts, regardless of whether the searching user * can view their respective profile. */ - public function test_message_search_users_messagingallusers_enabled() { + public function test_message_search_users_messagingallusers_enabled(): void { global $DB; $this->resetAfterTest(); @@ -4395,7 +4395,7 @@ class externallib_test extends externallib_advanced_testcase { /** * Test verifying get_conversations identifies if a conversation is muted or not. */ - public function test_get_conversations_some_muted() { + public function test_get_conversations_some_muted(): void { $this->resetAfterTest(); // Create some users. @@ -5518,7 +5518,7 @@ class externallib_test extends externallib_advanced_testcase { $expectedcounts, $expectedunreadcounts, $deletedusers - ) { + ): void { $this->resetAfterTest(); $generator = $this->getDataGenerator(); $users = [ @@ -5615,7 +5615,7 @@ class externallib_test extends externallib_advanced_testcase { $expectedcounts, $expectedunreadcounts, $deletedusers - ) { + ): void { $this->resetAfterTest(); $generator = $this->getDataGenerator(); $users = [ diff --git a/message/tests/privacy/provider_test.php b/message/tests/privacy/provider_test.php index f3f6c8f82fb..8f8cb4a6a7d 100644 --- a/message/tests/privacy/provider_test.php +++ b/message/tests/privacy/provider_test.php @@ -1048,7 +1048,7 @@ class provider_test extends \core_privacy\tests\provider_testcase { /** * Test for provider::delete_data_for_user(). */ - public function test_delete_data_for_user() { + public function test_delete_data_for_user(): void { global $DB; $this->resetAfterTest(); @@ -1382,7 +1382,7 @@ class provider_test extends \core_privacy\tests\provider_testcase { /** * Test for provider::delete_data_for_users(). */ - public function test_delete_data_for_users() { + public function test_delete_data_for_users(): void { global $DB; $this->resetAfterTest(); @@ -1866,7 +1866,7 @@ class provider_test extends \core_privacy\tests\provider_testcase { /** * Test for provider::delete_conversations_for_all_users(). */ - public function test_delete_conversations_for_all_users() { + public function test_delete_conversations_for_all_users(): void { global $DB; $this->resetAfterTest(); @@ -2391,7 +2391,7 @@ class provider_test extends \core_privacy\tests\provider_testcase { /** * Test for provider::delete_conversations_for_user(). */ - public function test_delete_conversations_for_user() { + public function test_delete_conversations_for_user(): void { global $DB; $this->resetAfterTest(); @@ -2589,7 +2589,7 @@ class provider_test extends \core_privacy\tests\provider_testcase { /** * Test for provider::delete_conversations_for_users(). */ - public function test_delete_conversations_for_users() { + public function test_delete_conversations_for_users(): void { global $DB; $this->resetAfterTest(); diff --git a/mod/assign/tests/external/start_submission_test.php b/mod/assign/tests/external/start_submission_test.php index 2394ceaf9fc..682d7d22163 100644 --- a/mod/assign/tests/external/start_submission_test.php +++ b/mod/assign/tests/external/start_submission_test.php @@ -69,7 +69,7 @@ class start_submission_test extends \mod_assign\externallib_advanced_testcase { /** * Test start_submission if assignment cut off date has elapsed. */ - public function test_start_submission_when_assignment_past_due_date() { + public function test_start_submission_when_assignment_past_due_date(): void { $fiveminago = time() - 300; list($assign, $instance, $student1, $student2, $teacher, $g1, $g2) = $this->create_submission_for_testing_status( false, ['cutoffdate' => $fiveminago]); @@ -87,7 +87,7 @@ class start_submission_test extends \mod_assign\externallib_advanced_testcase { /** * Test start_submission if time limit is disabled. */ - public function test_start_submission_when_time_limit_disabled() { + public function test_start_submission_when_time_limit_disabled(): void { list($assign, $instance, $student1, $student2, $teacher, $g1, $g2) = $this->create_submission_for_testing_status(); $result = start_submission::execute($instance->id); $filteredwarnings = array_filter($result['warnings'], function($warning) { @@ -103,7 +103,7 @@ class start_submission_test extends \mod_assign\externallib_advanced_testcase { /** * Test start_submission if time limit is not set for assignment. */ - public function test_start_submission_when_time_limit_not_set() { + public function test_start_submission_when_time_limit_not_set(): void { set_config('enabletimelimit', '1', 'assign'); list($assign, $instance, $student1, $student2, $teacher, $g1, $g2) = $this->create_submission_for_testing_status(); $result = start_submission::execute($instance->id); @@ -120,7 +120,7 @@ class start_submission_test extends \mod_assign\externallib_advanced_testcase { /** * Test start_submission if user already has open submission. */ - public function test_start_submission_when_submission_already_open() { + public function test_start_submission_when_submission_already_open(): void { global $DB; set_config('enabletimelimit', '1', 'assign'); list($assign, $instance, $student1, $student2, $teacher, $g1, $g2) = $this->create_submission_for_testing_status( @@ -142,7 +142,7 @@ class start_submission_test extends \mod_assign\externallib_advanced_testcase { /** * Test start_submission if user has already submitted with no additional attempts available. */ - public function test_start_submission_with_no_attempts_available() { + public function test_start_submission_with_no_attempts_available(): void { global $DB; set_config('enabletimelimit', '1', 'assign'); list($assign, $instance, $student1, $student2, $teacher, $g1, $g2) = $this->create_submission_for_testing_status( diff --git a/mod/assign/tests/externallib_test.php b/mod/assign/tests/externallib_test.php index 7919f6bab41..1e519aba23e 100644 --- a/mod/assign/tests/externallib_test.php +++ b/mod/assign/tests/externallib_test.php @@ -332,7 +332,7 @@ class externallib_test extends \mod_assign\externallib_advanced_testcase { /** * Test get_assignments with submissionstatement. */ - public function test_get_assignments_with_submissionstatement() { + public function test_get_assignments_with_submissionstatement(): void { global $DB, $USER, $CFG; $this->resetAfterTest(true); diff --git a/mod/assign/tests/lib_test.php b/mod/assign/tests/lib_test.php index 42ffbeca3ec..a07412c540d 100644 --- a/mod/assign/tests/lib_test.php +++ b/mod/assign/tests/lib_test.php @@ -1377,7 +1377,7 @@ class lib_test extends \advanced_testcase { * able to update the assignment due date by changing the due date calendar * event. */ - public function test_teacher_role_can_update_due_event() { + public function test_teacher_role_can_update_due_event(): void { global $CFG, $DB; require_once($CFG->dirroot . '/calendar/lib.php'); diff --git a/mod/bigbluebuttonbn/tests/external/get_recordings_test.php b/mod/bigbluebuttonbn/tests/external/get_recordings_test.php index 556c894d3be..ddda640e7cd 100644 --- a/mod/bigbluebuttonbn/tests/external/get_recordings_test.php +++ b/mod/bigbluebuttonbn/tests/external/get_recordings_test.php @@ -379,7 +379,7 @@ class get_recordings_test extends \externallib_advanced_testcase { * @covers \mod_bigbluebuttonbn\external\get_recordings::execute * @dataProvider recording_group_test_data */ - public function test_get_recordings_groups($type, $groups, $users, $recordingsdata, $test, $coursemode) { + public function test_get_recordings_groups($type, $groups, $users, $recordingsdata, $test, $coursemode): void { $this->resetAfterTest(); $dataset = compact('type', 'groups', 'users', 'recordingsdata', 'test', 'coursemode'); $activityid = $this->create_from_dataset($dataset); diff --git a/mod/bigbluebuttonbn/tests/lib_test.php b/mod/bigbluebuttonbn/tests/lib_test.php index 166ee95bd19..1fb00a50bd5 100644 --- a/mod/bigbluebuttonbn/tests/lib_test.php +++ b/mod/bigbluebuttonbn/tests/lib_test.php @@ -130,7 +130,7 @@ class lib_test extends \advanced_testcase { * * @covers ::bigbluebuttonbn_delete_instance */ - public function test_bigbluebuttonbn_delete_instance_with_running_group_meetings() { + public function test_bigbluebuttonbn_delete_instance_with_running_group_meetings(): void { $this->resetAfterTest(); $this->initialise_mock_server(); $datagenerator = $this->getDataGenerator(); @@ -224,7 +224,7 @@ class lib_test extends \advanced_testcase { * * @covers ::bigbluebuttonbn_get_recent_mod_activity */ - public function test_bigbluebuttonbn_get_recent_mod_activity() { + public function test_bigbluebuttonbn_get_recent_mod_activity(): void { $this->initialise_mock_server(); $this->resetAfterTest(); diff --git a/mod/bigbluebuttonbn/tests/local/proxy/recording_proxy_test.php b/mod/bigbluebuttonbn/tests/local/proxy/recording_proxy_test.php index e50dd4a1c0e..829597a9146 100644 --- a/mod/bigbluebuttonbn/tests/local/proxy/recording_proxy_test.php +++ b/mod/bigbluebuttonbn/tests/local/proxy/recording_proxy_test.php @@ -37,7 +37,7 @@ class recording_proxy_test extends \advanced_testcase { * * @return void */ - public function test_fetch_recordings() { + public function test_fetch_recordings(): void { $this->resetAfterTest(); $this->initialise_mock_server(); [$context, $cm, $bbbactivity] = $this->create_instance(); @@ -55,7 +55,7 @@ class recording_proxy_test extends \advanced_testcase { * * @return void */ - public function test_fetch_recordings_breakoutroom() { + public function test_fetch_recordings_breakoutroom(): void { $this->resetAfterTest(); $this->initialise_mock_server(); [$context, $cm, $bbbactivity] = $this->create_instance(); diff --git a/mod/bigbluebuttonbn/tests/output/recording_row_playback_test.php b/mod/bigbluebuttonbn/tests/output/recording_row_playback_test.php index 510a789c604..2c859d778ec 100644 --- a/mod/bigbluebuttonbn/tests/output/recording_row_playback_test.php +++ b/mod/bigbluebuttonbn/tests/output/recording_row_playback_test.php @@ -95,7 +95,7 @@ class recording_row_playback_test extends \advanced_testcase { * @covers \recording_row_playback::should_be_included * @dataProvider should_be_included_data_provider */ - public function test_should_be_included(string $role, array $canview, object $globalsettings = null) { + public function test_should_be_included(string $role, array $canview, object $globalsettings = null): void { global $PAGE; $this->resetAfterTest(); ['recordings' => $recordingsdata, 'activity' => $activity] = $this->create_activity_with_recordings( diff --git a/mod/choice/tests/lib_test.php b/mod/choice/tests/lib_test.php index a5a7108db7a..9cd5eecf49f 100644 --- a/mod/choice/tests/lib_test.php +++ b/mod/choice/tests/lib_test.php @@ -889,7 +889,7 @@ class lib_test extends \externallib_advanced_testcase { * A CHOICE_EVENT_TYPE_OPEN event should update the timeopen property of * the choice activity. */ - public function test_mod_choice_core_calendar_event_timestart_updated_open_event() { + public function test_mod_choice_core_calendar_event_timestart_updated_open_event(): void { global $CFG, $DB; require_once($CFG->dirroot . "/calendar/lib.php"); @@ -950,7 +950,7 @@ class lib_test extends \externallib_advanced_testcase { * A CHOICE_EVENT_TYPE_CLOSE event should update the timeclose property of * the choice activity. */ - public function test_mod_choice_core_calendar_event_timestart_updated_close_event() { + public function test_mod_choice_core_calendar_event_timestart_updated_close_event(): void { global $CFG, $DB; require_once($CFG->dirroot . "/calendar/lib.php"); diff --git a/mod/data/tests/lib_test.php b/mod/data/tests/lib_test.php index 1e4c7a45ff1..15b19428997 100644 --- a/mod/data/tests/lib_test.php +++ b/mod/data/tests/lib_test.php @@ -1706,7 +1706,7 @@ class lib_test extends \advanced_testcase { /** * A DATA_EVENT_TYPE_OPEN event should update the timeavailablefrom property of the data activity. */ - public function test_mod_data_core_calendar_event_timestart_updated_open_event() { + public function test_mod_data_core_calendar_event_timestart_updated_open_event(): void { global $CFG, $DB; require_once($CFG->dirroot . "/calendar/lib.php"); @@ -1763,7 +1763,7 @@ class lib_test extends \advanced_testcase { /** * A DATA_EVENT_TYPE_CLOSE event should update the timeavailableto property of the data activity. */ - public function test_mod_data_core_calendar_event_timestart_updated_close_event() { + public function test_mod_data_core_calendar_event_timestart_updated_close_event(): void { global $CFG, $DB; require_once($CFG->dirroot . "/calendar/lib.php"); diff --git a/mod/data/tests/manager_test.php b/mod/data/tests/manager_test.php index 65d829a1109..3fae83e2d86 100644 --- a/mod/data/tests/manager_test.php +++ b/mod/data/tests/manager_test.php @@ -222,7 +222,7 @@ class manager_test extends \advanced_testcase { * * @covers ::get_available_presets */ - public function test_get_available_presets() { + public function test_get_available_presets(): void { global $DB; $this->resetAfterTest(); @@ -323,7 +323,7 @@ class manager_test extends \advanced_testcase { * * @covers ::get_available_plugin_presets */ - public function test_get_available_plugin_presets() { + public function test_get_available_plugin_presets(): void { $this->resetAfterTest(); $this->setAdminUser(); @@ -369,7 +369,7 @@ class manager_test extends \advanced_testcase { * * @covers ::get_available_saved_presets */ - public function test_get_available_saved_presets() { + public function test_get_available_saved_presets(): void { global $DB; $this->resetAfterTest(); diff --git a/mod/data/tests/preset_test.php b/mod/data/tests/preset_test.php index 4df4c3b38fe..163bfd09545 100644 --- a/mod/data/tests/preset_test.php +++ b/mod/data/tests/preset_test.php @@ -208,7 +208,7 @@ class preset_test extends \advanced_testcase { * * @covers ::save */ - public function test_save_new_preset() { + public function test_save_new_preset(): void { $this->resetAfterTest(); $this->setAdminUser(); diff --git a/mod/feedback/tests/lib_test.php b/mod/feedback/tests/lib_test.php index ebddb43138c..0656b3fc2f1 100644 --- a/mod/feedback/tests/lib_test.php +++ b/mod/feedback/tests/lib_test.php @@ -1076,7 +1076,7 @@ class lib_test extends \advanced_testcase { * The activity should update if a teacher modifies the calendar * event. */ - public function test_teacher_role_can_update_time_close_event() { + public function test_teacher_role_can_update_time_close_event(): void { global $CFG, $DB; require_once($CFG->dirroot . '/calendar/lib.php'); diff --git a/mod/forum/tests/builders_exported_posts_test.php b/mod/forum/tests/builders_exported_posts_test.php index c8822db5fd5..fd88c64363a 100644 --- a/mod/forum/tests/builders_exported_posts_test.php +++ b/mod/forum/tests/builders_exported_posts_test.php @@ -142,7 +142,7 @@ class builders_exported_posts_test extends \advanced_testcase { * Test the build function returns the exported posts in the order that the posts are * given. */ - public function test_build_returns_posts_in_order() { + public function test_build_returns_posts_in_order(): void { $this->resetAfterTest(); $datagenerator = $this->getDataGenerator(); @@ -185,7 +185,7 @@ class builders_exported_posts_test extends \advanced_testcase { /** * Test the build function loads authors. */ - public function test_build_loads_authors() { + public function test_build_loads_authors(): void { $this->resetAfterTest(); $datagenerator = $this->getDataGenerator(); @@ -230,7 +230,7 @@ class builders_exported_posts_test extends \advanced_testcase { /** * Test the build function loads attachments. */ - public function test_build_loads_attachments() { + public function test_build_loads_attachments(): void { $this->resetAfterTest(); $datagenerator = $this->getDataGenerator(); @@ -306,7 +306,7 @@ class builders_exported_posts_test extends \advanced_testcase { /** * Test the build function loads author groups. */ - public function test_build_loads_author_groups() { + public function test_build_loads_author_groups(): void { $this->resetAfterTest(); $datagenerator = $this->getDataGenerator(); @@ -376,7 +376,7 @@ class builders_exported_posts_test extends \advanced_testcase { /** * Test the build function loads tags. */ - public function test_build_loads_tags() { + public function test_build_loads_tags(): void { $this->resetAfterTest(); $datagenerator = $this->getDataGenerator(); @@ -437,7 +437,7 @@ class builders_exported_posts_test extends \advanced_testcase { /** * Test the build function loads read_receipts. */ - public function test_build_loads_read_receipts() { + public function test_build_loads_read_receipts(): void { $this->resetAfterTest(); $datagenerator = $this->getDataGenerator(); diff --git a/mod/forum/tests/entities_sorter_test.php b/mod/forum/tests/entities_sorter_test.php index 28e32e285a6..62b4697fcf2 100644 --- a/mod/forum/tests/entities_sorter_test.php +++ b/mod/forum/tests/entities_sorter_test.php @@ -29,7 +29,7 @@ class entities_sorter_test extends \advanced_testcase { /** * Test the entity returns expected values. */ - public function test_entity_sort_into_children() { + public function test_entity_sort_into_children(): void { $this->resetAfterTest(); $sorter = new sorter_entity( function($entity) { @@ -59,7 +59,7 @@ class entities_sorter_test extends \advanced_testcase { /** * Test the entity returns expected values. */ - public function test_entity_flatten_children() { + public function test_entity_flatten_children(): void { $this->resetAfterTest(); $sorter = new sorter_entity( function($entity) { diff --git a/mod/forum/tests/privacy/provider_test.php b/mod/forum/tests/privacy/provider_test.php index 0e47f7fefd6..11f18124b65 100644 --- a/mod/forum/tests/privacy/provider_test.php +++ b/mod/forum/tests/privacy/provider_test.php @@ -1063,7 +1063,7 @@ class provider_test extends \core_privacy\tests\provider_testcase { /** * Ensure that all user data is deleted from a context. */ - public function test_all_users_deleted_from_context() { + public function test_all_users_deleted_from_context(): void { global $DB; $fs = get_file_storage(); @@ -1268,7 +1268,7 @@ class provider_test extends \core_privacy\tests\provider_testcase { /** * Ensure that all user data is deleted for a specific context. */ - public function test_delete_data_for_user() { + public function test_delete_data_for_user(): void { global $DB; $fs = get_file_storage(); @@ -1483,7 +1483,7 @@ class provider_test extends \core_privacy\tests\provider_testcase { /** * Ensure that user data for specific users is deleted from a specified context. */ - public function test_delete_data_for_users() { + public function test_delete_data_for_users(): void { global $DB; $fs = get_file_storage(); diff --git a/mod/forum/tests/vaults_forum_test.php b/mod/forum/tests/vaults_forum_test.php index 71b1210fccd..e240764f6e6 100644 --- a/mod/forum/tests/vaults_forum_test.php +++ b/mod/forum/tests/vaults_forum_test.php @@ -85,7 +85,7 @@ class vaults_forum_test extends \advanced_testcase { * * @covers ::get_from_course_module_ids */ - public function test_get_from_course_module_ids() { + public function test_get_from_course_module_ids(): void { $this->resetAfterTest(); $vaultfactory = \mod_forum\local\container::get_vault_factory(); diff --git a/mod/h5pactivity/tests/external/get_h5pactivities_by_courses_test.php b/mod/h5pactivity/tests/external/get_h5pactivities_by_courses_test.php index 17e80c82bfc..33908fccfa5 100644 --- a/mod/h5pactivity/tests/external/get_h5pactivities_by_courses_test.php +++ b/mod/h5pactivity/tests/external/get_h5pactivities_by_courses_test.php @@ -48,7 +48,7 @@ class get_h5pactivities_by_courses_test extends externallib_advanced_testcase { /** * Test test_get_h5pactivities_by_courses user student. */ - public function test_get_h5pactivities_by_courses() { + public function test_get_h5pactivities_by_courses(): void { global $CFG, $DB; $this->resetAfterTest(); diff --git a/mod/lesson/tests/lib_test.php b/mod/lesson/tests/lib_test.php index 17a2e63ea76..0f6e6406fc6 100644 --- a/mod/lesson/tests/lib_test.php +++ b/mod/lesson/tests/lib_test.php @@ -827,7 +827,7 @@ class lib_test extends \advanced_testcase { /** * A LESSON_EVENT_TYPE_OPEN event should update the available property of the lesson activity. */ - public function test_mod_lesson_core_calendar_event_timestart_updated_open_event() { + public function test_mod_lesson_core_calendar_event_timestart_updated_open_event(): void { global $CFG, $DB; require_once($CFG->dirroot . "/calendar/lib.php"); @@ -887,7 +887,7 @@ class lib_test extends \advanced_testcase { /** * A LESSON_EVENT_TYPE_CLOSE event should update the deadline property of the lesson activity. */ - public function test_mod_lesson_core_calendar_event_timestart_updated_close_event() { + public function test_mod_lesson_core_calendar_event_timestart_updated_close_event(): void { global $CFG, $DB; require_once($CFG->dirroot . "/calendar/lib.php"); $this->resetAfterTest(true); diff --git a/mod/quiz/tests/calendar_event_modified_test.php b/mod/quiz/tests/calendar_event_modified_test.php index 5e52b277435..6caf143da6b 100644 --- a/mod/quiz/tests/calendar_event_modified_test.php +++ b/mod/quiz/tests/calendar_event_modified_test.php @@ -273,7 +273,7 @@ class calendar_event_modified_test extends \advanced_testcase { * able to update the quiz activity dates by changing the calendar * event. */ - public function test_teacher_role_can_update_quiz_activity() { + public function test_teacher_role_can_update_quiz_activity(): void { global $DB; $this->resetAfterTest(); diff --git a/mod/quiz/tests/local_structure_slot_random_test.php b/mod/quiz/tests/local_structure_slot_random_test.php index 039f159cea9..dd2a764ad4f 100644 --- a/mod/quiz/tests/local_structure_slot_random_test.php +++ b/mod/quiz/tests/local_structure_slot_random_test.php @@ -226,7 +226,7 @@ class local_structure_slot_random_test extends \advanced_testcase { (array)json_decode($tagspropery)->filters->qtagids->values); } - public function test_insert() { + public function test_insert(): void { global $SITE; $this->resetAfterTest(); diff --git a/mod/scorm/tests/externallib_test.php b/mod/scorm/tests/externallib_test.php index c365adfdea5..3f7fbc5fa0a 100644 --- a/mod/scorm/tests/externallib_test.php +++ b/mod/scorm/tests/externallib_test.php @@ -227,7 +227,7 @@ class externallib_test extends externallib_advanced_testcase { /** * Test get scorm scoes */ - public function test_mod_scorm_get_scorm_scoes() { + public function test_mod_scorm_get_scorm_scoes(): void { global $DB; $this->resetAfterTest(true); diff --git a/mod/scorm/tests/lib_test.php b/mod/scorm/tests/lib_test.php index 8d85bad93d4..01fb3cd6d5a 100644 --- a/mod/scorm/tests/lib_test.php +++ b/mod/scorm/tests/lib_test.php @@ -633,7 +633,7 @@ class lib_test extends \advanced_testcase { * A SCORM_EVENT_TYPE_OPEN event should update the timeopen property of * the scorm activity. */ - public function test_mod_scorm_core_calendar_event_timestart_updated_open_event() { + public function test_mod_scorm_core_calendar_event_timestart_updated_open_event(): void { global $CFG, $DB; require_once($CFG->dirroot . "/calendar/lib.php"); @@ -694,7 +694,7 @@ class lib_test extends \advanced_testcase { * A SCORM_EVENT_TYPE_CLOSE event should update the timeclose property of * the scorm activity. */ - public function test_mod_scorm_core_calendar_event_timestart_updated_close_event() { + public function test_mod_scorm_core_calendar_event_timestart_updated_close_event(): void { global $CFG, $DB; require_once($CFG->dirroot . "/calendar/lib.php"); diff --git a/mod/wiki/tests/privacy/provider_test.php b/mod/wiki/tests/privacy/provider_test.php index e39ef8d3feb..2a442027468 100644 --- a/mod/wiki/tests/privacy/provider_test.php +++ b/mod/wiki/tests/privacy/provider_test.php @@ -327,7 +327,7 @@ class provider_test extends provider_testcase { /** * Export data for user 1 */ - public function test_export_user_data1() { + public function test_export_user_data1(): void { // Export all contexts for the first user. $contextids = array_values(array_map(function($c) { @@ -383,7 +383,7 @@ class provider_test extends provider_testcase { /** * Test export data for user 2 */ - public function test_export_user_data2() { + public function test_export_user_data2(): void { // Export all contexts for the second user. $contextids = array_values(array_map(function($c) { @@ -434,7 +434,7 @@ class provider_test extends provider_testcase { /** * Test export data for user 3 (locks, empty individual wiki) */ - public function test_export_user_data3() { + public function test_export_user_data3(): void { // Export all contexts for the third user. $contextids = array_values(array_map(function($c) { @@ -515,7 +515,7 @@ class provider_test extends provider_testcase { /** * Test export data when there are comments. */ - public function test_export_user_data_with_comments() { + public function test_export_user_data_with_comments(): void { global $DB; // Comment on each page in the first wiki as the first user. $this->setUser($this->users[1]); diff --git a/privacy/tests/moodle_content_writer_test.php b/privacy/tests/moodle_content_writer_test.php index 7b281a9ded7..d718f70ca6c 100644 --- a/privacy/tests/moodle_content_writer_test.php +++ b/privacy/tests/moodle_content_writer_test.php @@ -705,7 +705,7 @@ class moodle_content_writer_test extends advanced_testcase { * * @covers ::export_user_preference */ - public function test_export_user_preference_context_block_multiple_instances() { + public function test_export_user_preference_context_block_multiple_instances(): void { $this->resetAfterTest(); $generator = $this->getDataGenerator(); @@ -1323,7 +1323,7 @@ class moodle_content_writer_test extends advanced_testcase { ]; } - public function test_export_html_functions() { + public function test_export_html_functions(): void { $this->resetAfterTest(); $data = (object) ['key' => 'value']; diff --git a/question/tests/externallib_test.php b/question/tests/externallib_test.php index 002c8734271..f475cdd8dc4 100644 --- a/question/tests/externallib_test.php +++ b/question/tests/externallib_test.php @@ -195,7 +195,7 @@ class externallib_test extends externallib_advanced_testcase { $includesubcategories, $usetagnames, $expectedquestionindexes - ) { + ): void { $this->resetAfterTest(); $context = \context_system::instance(); @@ -365,7 +365,7 @@ class externallib_test extends externallib_advanced_testcase { /** * get_random_question_summaries should allow limiting and offsetting of the result set. */ - public function test_get_random_question_summaries_with_limit_and_offset() { + public function test_get_random_question_summaries_with_limit_and_offset(): void { $this->resetAfterTest(); $numberofquestions = 5; $includesubcategories = false; diff --git a/question/type/calculated/tests/question_type_test.php b/question/type/calculated/tests/question_type_test.php index 271c60792b1..f638bcdb29e 100644 --- a/question/type/calculated/tests/question_type_test.php +++ b/question/type/calculated/tests/question_type_test.php @@ -64,7 +64,7 @@ class question_type_test extends \advanced_testcase { $this->assertEquals(0.1, $this->qtype->get_random_guess_score($q)); } - public function test_load_question() { + public function test_load_question(): void { $this->resetAfterTest(); $syscontext = \context_system::instance(); diff --git a/question/type/multianswer/tests/question_type_test.php b/question/type/multianswer/tests/question_type_test.php index 34485048c64..6cc5a6aba2e 100644 --- a/question/type/multianswer/tests/question_type_test.php +++ b/question/type/multianswer/tests/question_type_test.php @@ -148,7 +148,7 @@ class question_type_test extends \advanced_testcase { $this->assertNull($this->qtype->get_random_guess_score($questiondata)); } - public function test_load_question() { + public function test_load_question(): void { $this->resetAfterTest(); $syscontext = \context_system::instance(); diff --git a/repository/contentbank/tests/search/search_test.php b/repository/contentbank/tests/search/search_test.php index 1ea14b9037f..d2896bc2b15 100644 --- a/repository/contentbank/tests/search/search_test.php +++ b/repository/contentbank/tests/search/search_test.php @@ -47,7 +47,7 @@ class search_test extends \advanced_testcase { * @param string $search The search string * @param array $expected The array containing the expected content names that should be returned by the search */ - public function test_get_search_contents(array $contentnames, string $search, array $expected) { + public function test_get_search_contents(array $contentnames, string $search, array $expected): void { $this->resetAfterTest(); $admin = get_admin(); diff --git a/repository/dropbox/tests/api_test.php b/repository/dropbox/tests/api_test.php index ea436006878..6aec039ce13 100644 --- a/repository/dropbox/tests/api_test.php +++ b/repository/dropbox/tests/api_test.php @@ -339,7 +339,7 @@ class api_test extends \advanced_testcase { /** * Some Dropbox endpoints require that the POSTFIELDS be set to null exactly. */ - public function test_fetch_dropbox_data_postfields_null() { + public function test_fetch_dropbox_data_postfields_null(): void { $mock = $this->getMockBuilder(\repository_dropbox\dropbox::class) ->disableOriginalConstructor() ->onlyMethods([ @@ -365,7 +365,7 @@ class api_test extends \advanced_testcase { /** * When data is specified, it should be json_encoded in POSTFIELDS. */ - public function test_fetch_dropbox_data_postfields_data() { + public function test_fetch_dropbox_data_postfields_data(): void { $mock = $this->getMockBuilder(\repository_dropbox\dropbox::class) ->disableOriginalConstructor() ->onlyMethods([ @@ -442,7 +442,7 @@ class api_test extends \advanced_testcase { /** * Base tests for the fetch_dropbox_content function. */ - public function test_fetch_dropbox_content() { + public function test_fetch_dropbox_content(): void { $mock = $this->getMockBuilder(\repository_dropbox\dropbox::class) ->disableOriginalConstructor() ->onlyMethods([ diff --git a/tag/tests/privacy/provider_test.php b/tag/tests/privacy/provider_test.php index 5394d27b940..a07b1bb5606 100644 --- a/tag/tests/privacy/provider_test.php +++ b/tag/tests/privacy/provider_test.php @@ -250,7 +250,7 @@ class provider_test extends provider_testcase { $this->assertEquals(0, $DB->count_records('tag_instance', [])); } - public function test_export_data_for_user() { + public function test_export_data_for_user(): void { global $DB; list($user1, $user2) = $this->set_up_tags(); $context = \context_system::instance(); diff --git a/tag/tests/taglib_test.php b/tag/tests/taglib_test.php index 7a973515e7c..96206f69bf4 100644 --- a/tag/tests/taglib_test.php +++ b/tag/tests/taglib_test.php @@ -325,7 +325,7 @@ class taglib_test extends \advanced_testcase { /** * Test for function compute_correlations() that is part of tag cron */ - public function test_correlations() { + public function test_correlations(): void { global $DB; $task = new \core\task\tag_cron_task(); @@ -929,7 +929,7 @@ class taglib_test extends \advanced_testcase { /** * Testing function core_tag_tag::combine_tags() when related tags are present. */ - public function test_combine_tags_with_related() { + public function test_combine_tags_with_related(): void { $collid = core_tag_collection::get_default(); $context = \context_system::instance(); core_tag_tag::set_item_tags('core', 'course', 10, $context, array('Cat', 'Cats', 'Dog')); @@ -1014,7 +1014,7 @@ class taglib_test extends \advanced_testcase { * have instances in the given context even when there is only a single * instance. */ - public function test_get_tags_by_area_in_contexts_single_tag_one_context() { + public function test_get_tags_by_area_in_contexts_single_tag_one_context(): void { $tagnames = ['foo']; $collid = core_tag_collection::get_default(); $tags = core_tag_tag::create_if_missing($collid, $tagnames); @@ -1043,7 +1043,7 @@ class taglib_test extends \advanced_testcase { * that have tag instances in for the area in the given context and * should ignore all tags that don't have an instance. */ - public function test_get_tags_by_area_in_contexts_multiple_tags_one_context() { + public function test_get_tags_by_area_in_contexts_multiple_tags_one_context(): void { $tagnames = ['foo', 'bar', 'baz']; $collid = core_tag_collection::get_default(); $tags = core_tag_tag::create_if_missing($collid, $tagnames); @@ -1073,7 +1073,7 @@ class taglib_test extends \advanced_testcase { * Tags with tag instances in the same area with in difference contexts * should be ignored. */ - public function test_get_tags_by_area_in_contexts_multiple_tags_multiple_contexts() { + public function test_get_tags_by_area_in_contexts_multiple_tags_multiple_contexts(): void { $tagnames = ['foo', 'bar', 'baz', 'bop', 'bam', 'bip']; $collid = core_tag_collection::get_default(); $tags = core_tag_tag::create_if_missing($collid, $tagnames); @@ -1191,7 +1191,7 @@ class taglib_test extends \advanced_testcase { * 3 => [] * ] */ - public function test_get_items_tags_missing_itemids() { + public function test_get_items_tags_missing_itemids(): void { $user1 = $this->getDataGenerator()->create_user(); $user2 = $this->getDataGenerator()->create_user(); $user3 = $this->getDataGenerator()->create_user(); @@ -1232,7 +1232,7 @@ class taglib_test extends \advanced_testcase { * set_item_tags should remove any tags that aren't in the given list and should * add any instances that are missing. */ - public function test_set_item_tags_no_multiple_context_add_remove_instances() { + public function test_set_item_tags_no_multiple_context_add_remove_instances(): void { $tagnames = ['foo', 'bar', 'baz', 'bop']; $collid = core_tag_collection::get_default(); $tags = core_tag_tag::create_if_missing($collid, $tagnames); @@ -1312,7 +1312,7 @@ class taglib_test extends \advanced_testcase { * the new set of tags, regardless of the context that the tag instance * is in. */ - public function test_set_item_tags_no_multiple_contex_deletes_old_instancest() { + public function test_set_item_tags_no_multiple_contex_deletes_old_instancest(): void { $tagnames = ['foo', 'bar', 'baz', 'bop']; $collid = core_tag_collection::get_default(); $tags = core_tag_tag::create_if_missing($collid, $tagnames); @@ -1361,7 +1361,7 @@ class taglib_test extends \advanced_testcase { * set_item_tags should not change tag instances in a different context to the one * it's opertating on if the tag area allows instances from multiple contexts. */ - public function test_set_item_tags_allow_multiple_context_doesnt_update_context() { + public function test_set_item_tags_allow_multiple_context_doesnt_update_context(): void { global $DB; $tagnames = ['foo', 'bar', 'bop']; $collid = core_tag_collection::get_default(); @@ -1414,7 +1414,7 @@ class taglib_test extends \advanced_testcase { * the new set of tags only in the same context if the tag area allows * multiple contexts. */ - public function test_set_item_tags_allow_multiple_context_deletes_instances_in_same_context() { + public function test_set_item_tags_allow_multiple_context_deletes_instances_in_same_context(): void { $tagnames = ['foo', 'bar', 'baz', 'bop']; $collid = core_tag_collection::get_default(); $tags = core_tag_tag::create_if_missing($collid, $tagnames); @@ -1458,7 +1458,7 @@ class taglib_test extends \advanced_testcase { * set_item_tags should allow multiple instances of the same tag in different * contexts if the tag area allows multiple contexts. */ - public function test_set_item_tags_allow_multiple_context_same_tag_multiple_contexts() { + public function test_set_item_tags_allow_multiple_context_same_tag_multiple_contexts(): void { $tagnames = ['foo']; $collid = core_tag_collection::get_default(); $tags = core_tag_tag::create_if_missing($collid, $tagnames); @@ -1788,7 +1788,7 @@ class taglib_test extends \advanced_testcase { * delete_instances should delete all tag instances for a component, item type * and context if given the component, itemtype, and context id as parameters. */ - public function test_delete_instances_with_component_and_itemtype_and_context() { + public function test_delete_instances_with_component_and_itemtype_and_context(): void { global $DB; $tagnames = ['foo', 'bar', 'baz']; diff --git a/user/tests/userlib_test.php b/user/tests/userlib_test.php index bdb44dc87d3..9f5183717fd 100644 --- a/user/tests/userlib_test.php +++ b/user/tests/userlib_test.php @@ -984,7 +984,7 @@ class userlib_test extends \advanced_testcase { * Test user_get_user_details_groups. * @covers ::user_get_user_details */ - public function test_user_get_user_details_groups() { + public function test_user_get_user_details_groups(): void { $this->resetAfterTest(); // Create user and modify user profile.