From 674497a12c200a7b2c7fdd559a5b692c26dc8be1 Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Tue, 28 May 2024 11:10:00 +0200 Subject: [PATCH] MDL-81523 phpunit: Add all missing setUp/tearDown parent calls All setUp(), tearDown(), setUpBeforeClass() and tearDownAfterClass() must, always, call to parent, to ensure that everything is properly set and cleaned. While in a lot of situations this is not needed (parents may not have anything to run), with PHPUnit >= 10 this can become more important because we are going to move the reset code from current placement @ runBare() to setUp()/tearDown(). Note that all the changes performed in this commit have been detected and fixed by moodle-cs (ParentSetUpTearDownSniffTest). --- admin/presets/tests/manager_test.php | 1 + admin/tool/behat/tests/external/get_entity_generator_test.php | 1 + .../tests/local/areas/core_question/questionanswers_test.php | 1 + .../tests/local/areas/core_question/questiontext_test.php | 1 + admin/tool/brickfield/tests/registration_test.php | 1 + admin/tool/capability/tests/event/events_test.php | 1 + admin/tool/cohortroles/tests/api_test.php | 1 + admin/tool/cohortroles/tests/privacy/provider_test.php | 1 + admin/tool/dataprivacy/tests/expired_data_requests_test.php | 1 + admin/tool/dataprivacy/tests/task/task_test.php | 1 + .../generator/tests/local/testscenario/steprunner_test.php | 1 + admin/tool/langimport/tests/event/events_test.php | 1 + admin/tool/log/store/database/tests/privacy/provider_test.php | 1 + admin/tool/log/store/standard/tests/privacy/provider_test.php | 1 + admin/tool/log/store/standard/tests/store_test.php | 1 + admin/tool/log/tests/privacy/provider_test.php | 1 + admin/tool/lp/tests/externallib_test.php | 1 + admin/tool/lpmigrate/tests/processor_test.php | 1 + admin/tool/messageinbound/tests/manager_test.php | 1 + admin/tool/messageinbound/tests/privacy/provider_test.php | 1 + admin/tool/mfa/factor/token/tests/factor_test.php | 1 + admin/tool/mobile/tests/privacy/provider_test.php | 1 + admin/tool/monitor/tests/event/events_test.php | 1 + admin/tool/monitor/tests/eventobservers_test.php | 1 + admin/tool/monitor/tests/generator_test.php | 1 + admin/tool/monitor/tests/privacy/provider_test.php | 1 + admin/tool/monitor/tests/rule_manager_test.php | 1 + admin/tool/monitor/tests/subscription_test.php | 1 + admin/tool/monitor/tests/task_check_subscriptions_test.php | 1 + admin/tool/monitor/tests/task_clean_events_test.php | 1 + admin/tool/policy/tests/externallib_test.php | 1 + admin/tool/policy/tests/privacy/provider_test.php | 1 + admin/tool/recyclebin/tests/category_bin_test.php | 1 + admin/tool/recyclebin/tests/course_bin_test.php | 1 + admin/tool/recyclebin/tests/event/events_test.php | 1 + admin/tool/uploaduser/tests/upload_users_test.php | 1 + admin/tool/usertours/tests/accessdate_filter_test.php | 1 + admin/tool/usertours/tests/manager_test.php | 2 ++ admin/tool/usertours/tests/role_filter_test.php | 1 + admin/tool/usertours/tests/step_test.php | 2 ++ admin/tool/usertours/tests/tour_test.php | 3 +++ analytics/tests/course_test.php | 1 + analytics/tests/dataset_manager_test.php | 1 + analytics/tests/model_test.php | 1 + analytics/tests/prediction_actions_test.php | 1 + analytics/tests/prediction_test.php | 1 + analytics/tests/privacy/provider_test.php | 1 + analytics/tests/stats_test.php | 1 + analytics/tests/time_splittings_test.php | 1 + auth/db/tests/db_test.php | 1 + auth/email/tests/external/external_test.php | 1 + auth/lti/tests/privacy/provider_test.php | 1 + auth/manual/tests/manual_test.php | 1 + auth/manual/tests/privacy/provider_test.php | 1 + auth/mnet/tests/privacy/provider_test.php | 1 + auth/oauth2/tests/privacy/provider_test.php | 1 + auth/tests/external/external_test.php | 1 + auth/tests/privacy/provider_test.php | 1 + availability/condition/completion/tests/condition_test.php | 1 + availability/condition/date/tests/condition_test.php | 1 + availability/condition/group/tests/condition_test.php | 1 + availability/condition/grouping/tests/condition_test.php | 1 + availability/condition/profile/tests/condition_test.php | 1 + availability/tests/info_test.php | 1 + availability/tests/tree_test.php | 1 + backup/controller/tests/controller_test.php | 1 + backup/converter/moodle1/tests/moodle1_converter_test.php | 2 ++ backup/moodle2/tests/backup_encrypted_content_test.php | 1 + backup/moodle2/tests/backup_stepslib_test.php | 1 + backup/moodle2/tests/restore_stepslib_test.php | 1 + backup/tests/automated_backup_test.php | 1 + backup/tests/backup_cleanup_task_test.php | 1 + backup/tests/externallib_test.php | 1 + backup/util/helper/tests/copy_helper_test.php | 1 + badges/tests/badgeslib_test.php | 1 + badges/tests/external/external_test.php | 1 + badges/tests/privacy/provider_test.php | 1 + blocks/accessreview/tests/accessibility_review_test.php | 1 + blocks/badges/tests/badges_test.php | 1 + blocks/blog_menu/tests/blog_menu_test.php | 1 + blocks/blog_recent/tests/blog_recent_test.php | 1 + blocks/blog_tags/tests/blog_tags_test.php | 1 + blocks/comments/tests/comments_test.php | 1 + blocks/comments/tests/event/events_test.php | 1 + blocks/comments/tests/privacy/provider_test.php | 1 + blocks/completionstatus/tests/completionstatus_test.php | 1 + blocks/globalsearch/tests/globalsearch_test.php | 1 + blocks/glossary_random/tests/glossary_random_test.php | 1 + blocks/lp/tests/lp_test.php | 1 + blocks/mnet_hosts/tests/mnet_hosts_test.php | 1 + blocks/online_users/tests/online_users_test.php | 1 + blocks/recentlyaccesseditems/tests/observer_test.php | 1 + blocks/rss_client/tests/privacy/provider_test.php | 1 + blocks/tags/tests/tags_test.php | 1 + blocks/tests/privacy/provider_test.php | 1 + blog/tests/privacy/provider_test.php | 1 + cache/stores/redis/tests/cachestore_cluster_redis_test.php | 1 + cache/tests/cache_test.php | 1 + calendar/tests/calendartype_test.php | 1 + calendar/tests/container_test.php | 1 + calendar/tests/event/events_test.php | 1 + calendar/tests/events_related_objects_cache_test.php | 1 + calendar/tests/externallib_test.php | 1 + calendar/tests/lib_test.php | 2 ++ calendar/tests/local_api_test.php | 1 + calendar/tests/privacy/provider_test.php | 1 + calendar/tests/rrule_manager_test.php | 1 + calendar/tests/std_proxy_test.php | 1 + cohort/tests/customfield/cohort_handler_test.php | 1 + cohort/tests/privacy/provider_test.php | 1 + comment/tests/externallib_test.php | 1 + comment/tests/privacy/provider_test.php | 1 + competency/tests/competency_override_test.php | 1 + competency/tests/external/external_test.php | 1 + competency/tests/privacy/provider_test.php | 1 + completion/tests/api_test.php | 1 + completion/tests/completion_criteria_test.php | 1 + completion/tests/progress_test.php | 1 + course/format/tests/external/get_state_test.php | 2 ++ course/format/tests/formatactions_test.php | 1 + course/format/tests/local/baseactions_test.php | 1 + course/format/tests/local/cmactions_test.php | 1 + course/format/tests/local/sectionactions_test.php | 1 + course/format/tests/sectiondelegate_test.php | 1 + course/format/weeks/tests/observer_test.php | 1 + course/tests/backup_restore_activity_test.php | 1 + course/tests/category_hooks_test.php | 1 + course/tests/courselib_test.php | 1 + course/tests/event/events_test.php | 1 + course/tests/externallib_test.php | 1 + course/tests/reportbuilder/datasource/participants_test.php | 1 + course/tests/search/search_test.php | 1 + customfield/field/checkbox/tests/plugin_test.php | 1 + customfield/field/date/tests/plugin_test.php | 1 + customfield/field/select/tests/plugin_test.php | 1 + customfield/field/text/tests/plugin_test.php | 1 + customfield/field/textarea/tests/plugin_test.php | 1 + enrol/database/tests/lib_test.php | 1 + enrol/database/tests/sync_test.php | 1 + enrol/flatfile/tests/privacy/provider_test.php | 1 + enrol/imsenterprise/tests/imsenterprise_test.php | 1 + enrol/imsenterprise/tests/imsenterprise_unenrol_test.php | 1 + enrol/lti/tests/data_connector_test.php | 1 + enrol/lti/tests/helper_test.php | 1 + enrol/lti/tests/lib_test.php | 1 + .../tests/local/ltiadvantage/entity/migration_claim_test.php | 1 + enrol/lti/tests/privacy/provider_test.php | 1 + enrol/lti/tests/sync_members_test.php | 1 + enrol/lti/tests/tool_provider_test.php | 1 + enrol/meta/tests/external/add_instances_test.php | 1 + enrol/meta/tests/external/delete_instances_test.php | 1 + enrol/paypal/tests/privacy/provider_test.php | 1 + enrol/tests/course_enrolment_manager_test.php | 1 + enrol/tests/role_external_test.php | 1 + favourites/tests/component_favourite_service_test.php | 1 + favourites/tests/privacy/provider_test.php | 1 + favourites/tests/repository_test.php | 1 + favourites/tests/user_favourite_service_test.php | 1 + grade/export/ods/tests/event/events_test.php | 1 + grade/export/txt/tests/event/events_test.php | 1 + grade/export/xls/tests/event/events_test.php | 1 + grade/export/xml/tests/event/events_test.php | 1 + grade/import/csv/tests/load_data_test.php | 1 + grade/report/grader/tests/privacy/provider_test.php | 1 + grade/report/overview/tests/externallib_test.php | 1 + grade/report/overview/tests/lib_test.php | 1 + grade/report/user/tests/lib_test.php | 1 + grade/report/user/tests/privacy/provider_test.php | 1 + grade/tests/event/events_test.php | 1 + grade/tests/importlib_test.php | 1 + grade/tests/output/general_action_bar_test.php | 1 + grade/tests/privacy/provider_test.php | 1 + group/tests/customfield/group_handler_test.php | 1 + group/tests/customfield/grouping_handler_test.php | 1 + h5p/tests/framework_test.php | 1 + h5p/tests/helper_test.php | 1 + iplookup/tests/geoip_test.php | 1 + iplookup/tests/geoplugin_test.php | 2 ++ lib/antivirus/clamav/tests/scanner_test.php | 2 ++ lib/dml/tests/pgsql_native_moodle_database_test.php | 1 + lib/external/tests/external_settings_test.php | 1 + lib/external/tests/privacy/provider_test.php | 1 + lib/external/tests/util_test.php | 2 ++ lib/filebrowser/tests/file_browser_test.php | 1 + lib/filestorage/tests/file_system_filedir_test.php | 2 ++ lib/filestorage/tests/file_system_test.php | 2 ++ lib/phpunit/tests/advanced_test.php | 1 + lib/tests/antivirus_test.php | 2 ++ lib/tests/attribute_helper_test.php | 1 + lib/tests/aws/admin_settings_aws_region_test.php | 1 + lib/tests/behat_lib_test.php | 1 + lib/tests/context_block_test.php | 1 + lib/tests/cron_test.php | 1 + lib/tests/csvclass_test.php | 1 + lib/tests/db/upgradelib_test.php | 1 + lib/tests/encryption_test.php | 2 ++ lib/tests/event/contentbank_content_created_test.php | 1 + lib/tests/event/contentbank_content_deleted_test.php | 1 + lib/tests/event/contentbank_content_updated_test.php | 1 + lib/tests/event/contentbank_content_uploaded_test.php | 1 + lib/tests/event/contentbank_content_viewed_test.php | 1 + lib/tests/event/events_test.php | 1 + lib/tests/event/profile_field_test.php | 1 + lib/tests/event/user_graded_test.php | 1 + lib/tests/exporter_test.php | 1 + lib/tests/gdlib_test.php | 1 + lib/tests/lock_test.php | 1 + lib/tests/modinfolib_test.php | 1 + lib/tests/myprofilelib_test.php | 2 ++ lib/tests/navigation/output/primary_test.php | 1 + lib/tests/output/language_menu_test.php | 1 + lib/tests/persistent_test.php | 1 + lib/tests/plugin_manager_test.php | 2 ++ lib/tests/plugininfo/base_test.php | 2 ++ lib/tests/questionlib_test.php | 1 + lib/tests/rsslib_test.php | 1 + lib/tests/session_redis_cluster_test.php | 1 + lib/tests/session_redis_test.php | 2 ++ lib/tests/task/calendar_cron_task_test.php | 1 + lib/tests/task/database_logger_test.php | 2 ++ lib/tests/task/logging_test.php | 1 + lib/tests/task/running_test.php | 1 + lib/tests/user_test.php | 1 + lib/tests/useragent_test.php | 1 + lib/tests/xhprof_test.php | 1 + lib/tests/xsendfilelib_test.php | 1 + lib/xapi/tests/api_test.php | 1 + lib/xapi/tests/external/delete_state_test.php | 1 + lib/xapi/tests/external/delete_states_test.php | 1 + lib/xapi/tests/external/get_state_test.php | 1 + lib/xapi/tests/external/get_states_test.php | 1 + lib/xapi/tests/external/post_state_test.php | 1 + lib/xapi/tests/external/post_statement_test.php | 1 + lib/xapi/tests/handler_test.php | 1 + lib/xapi/tests/privacy/provider_test.php | 1 + lib/xapi/tests/state_store_test.php | 1 + lib/xapi/tests/task/state_cleanup_task_test.php | 1 + message/output/airnotifier/tests/externallib_test.php | 1 + message/output/airnotifier/tests/privacy/provider_test.php | 1 + message/output/email/tests/privacy/provider_test.php | 1 + message/output/popup/tests/api_test.php | 1 + message/output/popup/tests/externallib_test.php | 1 + message/tests/event/events_test.php | 1 + message/tests/externallib_test.php | 1 + message/tests/helper_test.php | 1 + message/tests/inbound_test.php | 1 + message/tests/messagelib_test.php | 1 + message/tests/search_received_test.php | 1 + message/tests/search_sent_test.php | 1 + message/tests/task/migrate_message_data_test.php | 1 + mnet/service/enrol/tests/privacy/provider_test.php | 1 + mnet/tests/event/events_test.php | 1 + mod/assign/tests/base_test.php | 1 + mod/bigbluebuttonbn/tests/local/extension_test.php | 2 ++ mod/bigbluebuttonbn/tests/search_test.php | 1 + mod/book/tests/event/events_test.php | 1 + mod/book/tests/lib_test.php | 1 + mod/book/tests/search/search_test.php | 1 + mod/book/tool/exportimscp/tests/event/events_test.php | 1 + mod/book/tool/importhtml/tests/locallib_test.php | 1 + mod/book/tool/print/tests/event/events_test.php | 1 + mod/chat/tests/dates_test.php | 1 + mod/chat/tests/event/events_test.php | 1 + mod/chat/tests/externallib_test.php | 1 + mod/chat/tests/generator_test.php | 1 + mod/chat/tests/lib_test.php | 1 + mod/chat/tests/privacy/provider_test.php | 1 + mod/choice/tests/event/events_test.php | 1 + mod/choice/tests/privacy/provider_test.php | 1 + mod/data/tests/event/events_test.php | 1 + mod/data/tests/externallib_test.php | 1 + mod/data/tests/lib_test.php | 1 + mod/data/tests/privacy/provider_test.php | 1 + mod/feedback/tests/event/events_test.php | 1 + mod/feedback/tests/external/external_test.php | 1 + mod/feedback/tests/privacy/provider_test.php | 1 + mod/folder/tests/event/events_test.php | 1 + mod/folder/tests/lib_test.php | 2 ++ mod/folder/tests/search/search_test.php | 1 + mod/forum/tests/builders_exported_posts_test.php | 2 ++ mod/forum/tests/event/events_test.php | 2 ++ mod/forum/tests/exporters_discussion_test.php | 2 ++ mod/forum/tests/externallib_test.php | 2 ++ mod/forum/tests/generator_test.php | 2 ++ mod/forum/tests/lib_test.php | 2 ++ mod/forum/tests/mail_group_test.php | 2 ++ mod/forum/tests/mail_test.php | 2 ++ mod/forum/tests/maildigest_test.php | 2 ++ mod/forum/tests/managers_capability_test.php | 2 ++ mod/forum/tests/privacy/provider_test.php | 1 + mod/forum/tests/private_replies_test.php | 2 ++ mod/forum/tests/qanda_test.php | 2 ++ mod/forum/tests/search/search_test.php | 1 + mod/forum/tests/subscriptions_test.php | 2 ++ mod/forum/tests/vaults_discussion_list_test.php | 1 + mod/forum/tests/vaults_discussion_test.php | 1 + mod/forum/tests/vaults_post_test.php | 2 ++ mod/glossary/tests/event/events_test.php | 1 + mod/glossary/tests/privacy/provider_test.php | 1 + mod/glossary/tests/search/search_test.php | 1 + mod/h5pactivity/tests/lib_test.php | 1 + mod/h5pactivity/tests/xapi/handler_test.php | 1 + mod/label/tests/lib_test.php | 1 + mod/lesson/tests/event/events_test.php | 1 + mod/lesson/tests/external/external_test.php | 1 + mod/lesson/tests/privacy/provider_test.php | 1 + .../service/gradebookservices/tests/gradebookservices_test.php | 1 + .../service/gradebookservices/tests/privacy/provider_test.php | 1 + mod/lti/service/gradebookservices/tests/task/cleanup_test.php | 1 + mod/lti/service/memberships/tests/privacy/provider_test.php | 1 + .../tests/external/get_tool_types_and_proxies_count_test.php | 1 + mod/lti/tests/external/get_tool_types_and_proxies_test.php | 1 + mod/lti/tests/externallib_test.php | 1 + mod/lti/tests/lib_test.php | 1 + mod/lti/tests/task/clean_access_tokens_test.php | 1 + mod/page/tests/lib_test.php | 1 + mod/quiz/accessrule/seb/tests/rule_test.php | 1 + .../report/statistics/tests/quiz_statistics_report_test.php | 2 ++ mod/quiz/tests/external/external_test.php | 1 + .../quiz_notify_attempt_manual_grading_completed_test.php | 1 + mod/quiz/tests/repaginate_test.php | 1 + mod/quiz/tests/restore_attempt_test.php | 1 + mod/resource/tests/event/events_test.php | 1 + mod/resource/tests/lib_test.php | 1 + mod/resource/tests/search/search_test.php | 1 + mod/scorm/report/basic/tests/privacy/provider_test.php | 1 + mod/scorm/report/interactions/tests/privacy/provider_test.php | 1 + mod/scorm/report/objectives/tests/privacy/provider_test.php | 1 + mod/scorm/tests/event/events_test.php | 1 + mod/scorm/tests/externallib_test.php | 1 + mod/scorm/tests/lib_test.php | 1 + mod/scorm/tests/locallib_test.php | 1 + mod/survey/tests/event/events_test.php | 1 + mod/survey/tests/externallib_test.php | 1 + mod/survey/tests/generator_test.php | 1 + mod/survey/tests/lib_test.php | 2 ++ mod/survey/tests/privacy/provider_test.php | 1 + mod/survey/tests/search/search_test.php | 1 + mod/url/tests/lib_test.php | 1 + mod/wiki/tests/event/events_test.php | 1 + mod/wiki/tests/externallib_test.php | 1 + mod/wiki/tests/privacy/provider_test.php | 1 + mod/wiki/tests/search/search_test.php | 1 + mod/workshop/tests/external/external_test.php | 1 + mod/workshop/tests/privacy/provider_test.php | 1 + my/tests/event/events_test.php | 1 + my/tests/external/view_page_test.php | 1 + notes/tests/event/events_test.php | 1 + notes/tests/lib_test.php | 1 + notes/tests/reportbuilder/datasource/notes_test.php | 1 + privacy/tests/manager_test.php | 1 + privacy/tests/writer_test.php | 1 + .../bank/comment/tests/event/comment_created_deleted_test.php | 1 + question/bank/comment/tests/privacy/provider_test.php | 1 + question/bank/history/tests/helper_test.php | 1 + .../bank/previewquestion/tests/qbank_preview_helper_test.php | 1 + question/bank/tagquestion/tests/external/submit_tags_test.php | 1 + question/engine/tests/question_engine_test.php | 1 + question/engine/tests/questionattempt_test.php | 1 + question/engine/tests/questionattempt_with_steps_test.php | 2 ++ question/engine/tests/questionattemptiterator_test.php | 2 ++ question/engine/tests/questionattemptstepiterator_test.php | 2 ++ question/engine/tests/questionusage_autosave_test.php | 1 + question/engine/tests/unitofwork_test.php | 2 ++ question/tests/event/events_test.php | 1 + question/tests/externallib_test.php | 1 + question/type/calculated/tests/question_type_test.php | 2 ++ question/type/calculatedsimple/tests/question_type_test.php | 2 ++ question/type/ddimageortext/tests/question_type_test.php | 2 ++ question/type/ddmarker/tests/question_type_test.php | 2 ++ question/type/ddwtos/tests/question_type_test.php | 2 ++ question/type/description/tests/question_type_test.php | 2 ++ question/type/essay/tests/question_type_test.php | 2 ++ question/type/gapselect/tests/question_type_test.php | 2 ++ question/type/match/tests/question_type_test.php | 2 ++ question/type/multianswer/tests/question_type_test.php | 2 ++ question/type/multichoice/tests/question_type_test.php | 2 ++ question/type/numerical/tests/answerprocessor_test.php | 1 + question/type/numerical/tests/question_type_test.php | 2 ++ question/type/ordering/tests/questionhint_test.php | 2 ++ question/type/random/tests/question_type_test.php | 2 ++ question/type/shortanswer/tests/question_type_test.php | 2 ++ .../question_first_matching_answer_grading_strategy_test.php | 2 ++ question/type/truefalse/tests/question_type_test.php | 2 ++ rating/tests/externallib_test.php | 1 + report/completion/tests/event/events_test.php | 1 + report/log/tests/event/events_test.php | 1 + report/log/tests/lib_test.php | 1 + report/log/tests/renderable_test.php | 1 + report/loglive/tests/event/events_test.php | 1 + report/loglive/tests/table_log_test.php | 1 + report/outline/tests/lib_test.php | 1 + report/questioninstances/tests/event/events_test.php | 1 + report/stats/tests/event/events_test.php | 1 + report/stats/tests/lib_test.php | 1 + report/usersessions/tests/lib_test.php | 1 + reportbuilder/tests/external/system_report_exporter_test.php | 1 + .../tests/local/aggregation/groupconcatdistinct_test.php | 1 + reportbuilder/tests/local/report/base_test.php | 1 + repository/flickr/tests/privacy/provider_test.php | 1 + .../nextcloud/tests/access_controlled_link_manager_test.php | 1 + repository/nextcloud/tests/lib_test.php | 1 + repository/nextcloud/tests/ocs_test.php | 1 + repository/onedrive/tests/privacy/provider_test.php | 1 + repository/recent/tests/lib_test.php | 1 + repository/tests/privacy/provider_test.php | 1 + rss/tests/privacy/provider_test.php | 1 + search/engine/simpledb/tests/engine_test.php | 2 ++ search/engine/simpledb/tests/privacy/provider_test.php | 1 + search/engine/solr/tests/engine_test.php | 2 ++ search/tests/base_activity_test.php | 2 ++ search/tests/base_test.php | 2 ++ search/tests/document_test.php | 2 ++ search/tests/engine_test.php | 1 + search/tests/external/get_results_test.php | 1 + search/tests/external/get_search_areas_list_test.php | 1 + search/tests/external/get_top_results_test.php | 1 + search/tests/external/view_results_test.php | 1 + search/tests/external_test.php | 1 + search/tests/manager_test.php | 1 + tag/tests/event/events_test.php | 1 + tag/tests/taglib_test.php | 1 + user/profile/field/checkbox/tests/privacy/provider_test.php | 1 + .../field/checkbox/tests/profile_field_checkbox_test.php | 1 + user/profile/field/datetime/tests/privacy/provider_test.php | 1 + user/profile/field/menu/tests/privacy/provider_test.php | 1 + user/profile/field/social/tests/privacy/provider_test.php | 1 + user/profile/field/text/tests/privacy/provider_test.php | 1 + user/profile/field/textarea/tests/privacy/provider_test.php | 1 + user/tests/profilelib_test.php | 1 + user/tests/search/search_test.php | 1 + webservice/tests/event/events_test.php | 1 + 432 files changed, 495 insertions(+) diff --git a/admin/presets/tests/manager_test.php b/admin/presets/tests/manager_test.php index 2ab19814ebc..1690968221f 100644 --- a/admin/presets/tests/manager_test.php +++ b/admin/presets/tests/manager_test.php @@ -35,6 +35,7 @@ class manager_test extends \advanced_testcase { public static function setUpBeforeClass(): void { global $CFG; require_once($CFG->libdir.'/adminlib.php'); + parent::setUpBeforeClass(); } /** diff --git a/admin/tool/behat/tests/external/get_entity_generator_test.php b/admin/tool/behat/tests/external/get_entity_generator_test.php index 5ab04fd041e..b5daac11236 100644 --- a/admin/tool/behat/tests/external/get_entity_generator_test.php +++ b/admin/tool/behat/tests/external/get_entity_generator_test.php @@ -38,6 +38,7 @@ class get_entity_generator_test extends \advanced_testcase { * @return void */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); $this->setAdminUser(); } diff --git a/admin/tool/brickfield/tests/local/areas/core_question/questionanswers_test.php b/admin/tool/brickfield/tests/local/areas/core_question/questionanswers_test.php index 54564cbce26..6e9ecd2b02b 100644 --- a/admin/tool/brickfield/tests/local/areas/core_question/questionanswers_test.php +++ b/admin/tool/brickfield/tests/local/areas/core_question/questionanswers_test.php @@ -31,6 +31,7 @@ class questionanswers_test extends \advanced_testcase { public static function setUpBeforeClass(): void { global $CFG; require_once($CFG->dirroot . '/mod/quiz/locallib.php'); + parent::setUpBeforeClass(); } /** diff --git a/admin/tool/brickfield/tests/local/areas/core_question/questiontext_test.php b/admin/tool/brickfield/tests/local/areas/core_question/questiontext_test.php index 8fe63b0d25f..522e056d9fa 100644 --- a/admin/tool/brickfield/tests/local/areas/core_question/questiontext_test.php +++ b/admin/tool/brickfield/tests/local/areas/core_question/questiontext_test.php @@ -37,6 +37,7 @@ class questiontext_test extends area_test_base { public static function setUpBeforeClass(): void { global $CFG; require_once($CFG->dirroot . '/mod/quiz/locallib.php'); + parent::setUpBeforeClass(); } /** diff --git a/admin/tool/brickfield/tests/registration_test.php b/admin/tool/brickfield/tests/registration_test.php index b2f736dc74a..f980688c5d6 100644 --- a/admin/tool/brickfield/tests/registration_test.php +++ b/admin/tool/brickfield/tests/registration_test.php @@ -34,6 +34,7 @@ class registration_test extends \advanced_testcase { require_once($CFG->dirroot . '/admin/tool/brickfield/tests/generator/mock_registration.php'); require_once($CFG->dirroot . '/admin/tool/brickfield/tests/generator/mock_brickfieldconnect.php'); + parent::setUpBeforeClass(); } /** diff --git a/admin/tool/capability/tests/event/events_test.php b/admin/tool/capability/tests/event/events_test.php index 78d2ef5b67a..b483331f00d 100644 --- a/admin/tool/capability/tests/event/events_test.php +++ b/admin/tool/capability/tests/event/events_test.php @@ -37,6 +37,7 @@ class events_test extends \advanced_testcase { * Setup testcase. */ public function setUp(): void { + parent::setUp(); $this->setAdminUser(); $this->resetAfterTest(); } diff --git a/admin/tool/cohortroles/tests/api_test.php b/admin/tool/cohortroles/tests/api_test.php index e25f5394b07..f31e804f49f 100644 --- a/admin/tool/cohortroles/tests/api_test.php +++ b/admin/tool/cohortroles/tests/api_test.php @@ -43,6 +43,7 @@ class api_test extends \advanced_testcase { * Setup function- we will create a course and add an assign instance to it. */ protected function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); // Create some users. diff --git a/admin/tool/cohortroles/tests/privacy/provider_test.php b/admin/tool/cohortroles/tests/privacy/provider_test.php index 18fa5f041cd..56b8922b805 100644 --- a/admin/tool/cohortroles/tests/privacy/provider_test.php +++ b/admin/tool/cohortroles/tests/privacy/provider_test.php @@ -45,6 +45,7 @@ class provider_test extends \core_privacy\tests\provider_testcase { * Overriding setUp() function to always reset after tests. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); } diff --git a/admin/tool/dataprivacy/tests/expired_data_requests_test.php b/admin/tool/dataprivacy/tests/expired_data_requests_test.php index 0259a0774fc..2efa7c8015e 100644 --- a/admin/tool/dataprivacy/tests/expired_data_requests_test.php +++ b/admin/tool/dataprivacy/tests/expired_data_requests_test.php @@ -36,6 +36,7 @@ class expired_data_requests_test extends data_privacy_testcase { */ public function tearDown(): void { \core_privacy\local\request\writer::reset(); + parent::tearDown(); } /** diff --git a/admin/tool/dataprivacy/tests/task/task_test.php b/admin/tool/dataprivacy/tests/task/task_test.php index d43dbbdf63d..6f2000f614a 100644 --- a/admin/tool/dataprivacy/tests/task/task_test.php +++ b/admin/tool/dataprivacy/tests/task/task_test.php @@ -38,6 +38,7 @@ class task_test extends \data_privacy_testcase { */ public function tearDown(): void { \core_privacy\local\request\writer::reset(); + parent::tearDown(); } /** diff --git a/admin/tool/generator/tests/local/testscenario/steprunner_test.php b/admin/tool/generator/tests/local/testscenario/steprunner_test.php index 08d20c567a1..d66f5b12594 100644 --- a/admin/tool/generator/tests/local/testscenario/steprunner_test.php +++ b/admin/tool/generator/tests/local/testscenario/steprunner_test.php @@ -32,6 +32,7 @@ use Behat\Gherkin\Node\StepNode; */ class steprunner_test extends \advanced_testcase { public static function setUpBeforeClass(): void { + parent::setUpBeforeClass(); // Call the init method to include all behat libraries and attributes. $runner = new runner(); $runner->init(); diff --git a/admin/tool/langimport/tests/event/events_test.php b/admin/tool/langimport/tests/event/events_test.php index 2f87dd0d29e..c504a42dd84 100644 --- a/admin/tool/langimport/tests/event/events_test.php +++ b/admin/tool/langimport/tests/event/events_test.php @@ -37,6 +37,7 @@ class events_test extends \advanced_testcase { * Setup testcase. */ public function setUp(): void { + parent::setUp(); $this->setAdminUser(); $this->resetAfterTest(); } diff --git a/admin/tool/log/store/database/tests/privacy/provider_test.php b/admin/tool/log/store/database/tests/privacy/provider_test.php index a0edb7c4d10..9ef75ec0379 100644 --- a/admin/tool/log/store/database/tests/privacy/provider_test.php +++ b/admin/tool/log/store/database/tests/privacy/provider_test.php @@ -53,6 +53,7 @@ class provider_test extends provider_testcase { public function setUp(): void { global $CFG; + parent::setUp(); $this->resetAfterTest(); $this->preventResetByRollback(); // Logging waits till the transaction gets committed. diff --git a/admin/tool/log/store/standard/tests/privacy/provider_test.php b/admin/tool/log/store/standard/tests/privacy/provider_test.php index 651abc38a43..d00974038d0 100644 --- a/admin/tool/log/store/standard/tests/privacy/provider_test.php +++ b/admin/tool/log/store/standard/tests/privacy/provider_test.php @@ -49,6 +49,7 @@ require_once(__DIR__ . '/../fixtures/event.php'); class provider_test extends provider_testcase { public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); $this->preventResetByRollback(); // Logging waits till the transaction gets committed. } diff --git a/admin/tool/log/store/standard/tests/store_test.php b/admin/tool/log/store/standard/tests/store_test.php index a02e2d9d590..74c5c8deba6 100644 --- a/admin/tool/log/store/standard/tests/store_test.php +++ b/admin/tool/log/store/standard/tests/store_test.php @@ -547,5 +547,6 @@ class store_test extends \advanced_testcase { gc_enable(); } $this->wedisabledgc = false; + parent::tearDown(); } } diff --git a/admin/tool/log/tests/privacy/provider_test.php b/admin/tool/log/tests/privacy/provider_test.php index c71d8fecec1..60ee710fc22 100644 --- a/admin/tool/log/tests/privacy/provider_test.php +++ b/admin/tool/log/tests/privacy/provider_test.php @@ -53,6 +53,7 @@ require_once($CFG->dirroot . '/admin/tool/log/store/standard/tests/fixtures/even class provider_test extends provider_testcase { public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); $this->preventResetByRollback(); // Logging waits till the transaction gets committed. } diff --git a/admin/tool/lp/tests/externallib_test.php b/admin/tool/lp/tests/externallib_test.php index f2b779a5f0e..59b728678e0 100644 --- a/admin/tool/lp/tests/externallib_test.php +++ b/admin/tool/lp/tests/externallib_test.php @@ -64,6 +64,7 @@ class externallib_test extends externallib_advanced_testcase { */ protected function setUp(): void { global $DB, $CFG; + parent::setUp(); $this->resetAfterTest(true); diff --git a/admin/tool/lpmigrate/tests/processor_test.php b/admin/tool/lpmigrate/tests/processor_test.php index 2db7d2107c6..212299ea0b2 100644 --- a/admin/tool/lpmigrate/tests/processor_test.php +++ b/admin/tool/lpmigrate/tests/processor_test.php @@ -63,6 +63,7 @@ class processor_test extends \advanced_testcase { * Then we attach some competencies from the first framework to courses and CM. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); $dg = $this->getDataGenerator(); $lpg = $dg->get_plugin_generator('core_competency'); diff --git a/admin/tool/messageinbound/tests/manager_test.php b/admin/tool/messageinbound/tests/manager_test.php index da760cda99e..2915765b6ea 100644 --- a/admin/tool/messageinbound/tests/manager_test.php +++ b/admin/tool/messageinbound/tests/manager_test.php @@ -35,6 +35,7 @@ class manager_test extends provider_testcase { public function setUp(): void { global $CFG; + parent::setUp(); $this->resetAfterTest(); // Pretend the system is enabled. diff --git a/admin/tool/messageinbound/tests/privacy/provider_test.php b/admin/tool/messageinbound/tests/privacy/provider_test.php index a7e5fd25286..3ab8ec58010 100644 --- a/admin/tool/messageinbound/tests/privacy/provider_test.php +++ b/admin/tool/messageinbound/tests/privacy/provider_test.php @@ -49,6 +49,7 @@ class provider_test extends provider_testcase { public function setUp(): void { global $CFG; + parent::setUp(); $this->resetAfterTest(); // Pretend the system is enabled. diff --git a/admin/tool/mfa/factor/token/tests/factor_test.php b/admin/tool/mfa/factor/token/tests/factor_test.php index 4b8e3c43afd..d04bb5ccbb4 100644 --- a/admin/tool/mfa/factor/token/tests/factor_test.php +++ b/admin/tool/mfa/factor/token/tests/factor_test.php @@ -35,6 +35,7 @@ class factor_test extends \advanced_testcase { public \factor_token\factor $factor; public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); $this->factor = new \factor_token\factor('token'); } diff --git a/admin/tool/mobile/tests/privacy/provider_test.php b/admin/tool/mobile/tests/privacy/provider_test.php index eca409f1166..24864718739 100644 --- a/admin/tool/mobile/tests/privacy/provider_test.php +++ b/admin/tool/mobile/tests/privacy/provider_test.php @@ -43,6 +43,7 @@ class provider_test extends \core_privacy\tests\provider_testcase { * Basic setup for these tests. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); } diff --git a/admin/tool/monitor/tests/event/events_test.php b/admin/tool/monitor/tests/event/events_test.php index ffaf8a4f1b0..a6a7f032fef 100644 --- a/admin/tool/monitor/tests/event/events_test.php +++ b/admin/tool/monitor/tests/event/events_test.php @@ -34,6 +34,7 @@ class events_test extends \advanced_testcase { * Tests set up. */ public function setUp(): void { + parent::setUp(); set_config('enablemonitor', 1, 'tool_monitor'); $this->resetAfterTest(); } diff --git a/admin/tool/monitor/tests/eventobservers_test.php b/admin/tool/monitor/tests/eventobservers_test.php index d1581d17d8e..fe7bba7f015 100644 --- a/admin/tool/monitor/tests/eventobservers_test.php +++ b/admin/tool/monitor/tests/eventobservers_test.php @@ -35,6 +35,7 @@ class eventobservers_test extends \advanced_testcase { * Set up method. */ public function setUp(): void { + parent::setUp(); // Enable monitor. set_config('enablemonitor', 1, 'tool_monitor'); } diff --git a/admin/tool/monitor/tests/generator_test.php b/admin/tool/monitor/tests/generator_test.php index 235f6b79984..dd4ccc2362b 100644 --- a/admin/tool/monitor/tests/generator_test.php +++ b/admin/tool/monitor/tests/generator_test.php @@ -31,6 +31,7 @@ class generator_test extends \advanced_testcase { * Set up method. */ public function setUp(): void { + parent::setUp(); // Enable monitor. set_config('enablemonitor', 1, 'tool_monitor'); } diff --git a/admin/tool/monitor/tests/privacy/provider_test.php b/admin/tool/monitor/tests/privacy/provider_test.php index 957b5b17cd2..4c28b0de23b 100644 --- a/admin/tool/monitor/tests/privacy/provider_test.php +++ b/admin/tool/monitor/tests/privacy/provider_test.php @@ -45,6 +45,7 @@ class provider_test extends provider_testcase { * Set up method. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); // Enable monitor. set_config('enablemonitor', 1, 'tool_monitor'); diff --git a/admin/tool/monitor/tests/rule_manager_test.php b/admin/tool/monitor/tests/rule_manager_test.php index 9804c834fb7..18bbaddb263 100644 --- a/admin/tool/monitor/tests/rule_manager_test.php +++ b/admin/tool/monitor/tests/rule_manager_test.php @@ -30,6 +30,7 @@ class rule_manager_test extends \advanced_testcase { * Set up method. */ public function setUp(): void { + parent::setUp(); // Enable monitor. set_config('enablemonitor', 1, 'tool_monitor'); } diff --git a/admin/tool/monitor/tests/subscription_test.php b/admin/tool/monitor/tests/subscription_test.php index 552e8b64077..32d8a054ad4 100644 --- a/admin/tool/monitor/tests/subscription_test.php +++ b/admin/tool/monitor/tests/subscription_test.php @@ -36,6 +36,7 @@ class subscription_test extends \advanced_testcase { * Test set up. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); // Create the mock subscription. diff --git a/admin/tool/monitor/tests/task_check_subscriptions_test.php b/admin/tool/monitor/tests/task_check_subscriptions_test.php index 3944dc4f089..f479bd5eb31 100644 --- a/admin/tool/monitor/tests/task_check_subscriptions_test.php +++ b/admin/tool/monitor/tests/task_check_subscriptions_test.php @@ -39,6 +39,7 @@ class task_check_subscriptions_test extends \advanced_testcase { */ public function setUp(): void { global $DB; + parent::setUp(); set_config('enablemonitor', 1, 'tool_monitor'); $this->resetAfterTest(true); diff --git a/admin/tool/monitor/tests/task_clean_events_test.php b/admin/tool/monitor/tests/task_clean_events_test.php index e801ef37361..cae7a64bf05 100644 --- a/admin/tool/monitor/tests/task_clean_events_test.php +++ b/admin/tool/monitor/tests/task_clean_events_test.php @@ -30,6 +30,7 @@ class task_clean_events_test extends \advanced_testcase { * Test set up. */ public function setUp(): void { + parent::setUp(); set_config('enablemonitor', 1, 'tool_monitor'); $this->resetAfterTest(true); } diff --git a/admin/tool/policy/tests/externallib_test.php b/admin/tool/policy/tests/externallib_test.php index b4142457bbd..c00d1eedeaa 100644 --- a/admin/tool/policy/tests/externallib_test.php +++ b/admin/tool/policy/tests/externallib_test.php @@ -57,6 +57,7 @@ class externallib_test extends externallib_advanced_testcase { * Setup function- we will create some policy docs. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); $this->setAdminUser(); diff --git a/admin/tool/policy/tests/privacy/provider_test.php b/admin/tool/policy/tests/privacy/provider_test.php index 1140aff36a8..94600345988 100644 --- a/admin/tool/policy/tests/privacy/provider_test.php +++ b/admin/tool/policy/tests/privacy/provider_test.php @@ -53,6 +53,7 @@ class provider_test extends \core_privacy\tests\provider_testcase { * Setup function. Will create a user. */ protected function setUp(): void { + parent::setUp(); $this->resetAfterTest(); $generator = $this->getDataGenerator(); diff --git a/admin/tool/recyclebin/tests/category_bin_test.php b/admin/tool/recyclebin/tests/category_bin_test.php index 953a7019912..7876b7ac4b2 100644 --- a/admin/tool/recyclebin/tests/category_bin_test.php +++ b/admin/tool/recyclebin/tests/category_bin_test.php @@ -39,6 +39,7 @@ class category_bin_test extends \advanced_testcase { * Setup for each test. */ protected function setUp(): void { + parent::setUp(); $this->resetAfterTest(); $this->setAdminUser(); diff --git a/admin/tool/recyclebin/tests/course_bin_test.php b/admin/tool/recyclebin/tests/course_bin_test.php index c37a619ac59..d7ed2ec733e 100644 --- a/admin/tool/recyclebin/tests/course_bin_test.php +++ b/admin/tool/recyclebin/tests/course_bin_test.php @@ -42,6 +42,7 @@ class course_bin_test extends \advanced_testcase { * Setup for each test. */ protected function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); $this->setAdminUser(); diff --git a/admin/tool/recyclebin/tests/event/events_test.php b/admin/tool/recyclebin/tests/event/events_test.php index 2a203243488..c1b7635f954 100644 --- a/admin/tool/recyclebin/tests/event/events_test.php +++ b/admin/tool/recyclebin/tests/event/events_test.php @@ -41,6 +41,7 @@ class events_test extends \advanced_testcase { * This is executed before running any test in this file. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); // We want the category and course bin to be enabled. diff --git a/admin/tool/uploaduser/tests/upload_users_test.php b/admin/tool/uploaduser/tests/upload_users_test.php index 565b1d6ed42..82b19f6d7fa 100644 --- a/admin/tool/uploaduser/tests/upload_users_test.php +++ b/admin/tool/uploaduser/tests/upload_users_test.php @@ -40,6 +40,7 @@ class upload_users_test extends advanced_testcase { global $CFG; require_once("{$CFG->dirroot}/{$CFG->admin}/tool/uploaduser/locallib.php"); + parent::setUpBeforeClass(); } /** diff --git a/admin/tool/usertours/tests/accessdate_filter_test.php b/admin/tool/usertours/tests/accessdate_filter_test.php index 1458ee14763..31c9c7b1406 100644 --- a/admin/tool/usertours/tests/accessdate_filter_test.php +++ b/admin/tool/usertours/tests/accessdate_filter_test.php @@ -28,6 +28,7 @@ use tool_usertours\local\filter\accessdate; */ class accessdate_filter_test extends \advanced_testcase { public function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); } diff --git a/admin/tool/usertours/tests/manager_test.php b/admin/tool/usertours/tests/manager_test.php index 924ba268e85..3448f42713d 100644 --- a/admin/tool/usertours/tests/manager_test.php +++ b/admin/tool/usertours/tests/manager_test.php @@ -44,6 +44,7 @@ class manager_test extends \advanced_testcase { */ public function setUp(): void { global $DB; + parent::setUp(); $this->db = $DB; } @@ -55,6 +56,7 @@ class manager_test extends \advanced_testcase { global $DB; $DB = $this->db; + parent::tearDown(); } /** diff --git a/admin/tool/usertours/tests/role_filter_test.php b/admin/tool/usertours/tests/role_filter_test.php index ceff72fb39b..7e0a900b85c 100644 --- a/admin/tool/usertours/tests/role_filter_test.php +++ b/admin/tool/usertours/tests/role_filter_test.php @@ -55,6 +55,7 @@ class role_filter_test extends \advanced_testcase { public function setUp(): void { global $DB; + parent::setUp(); $this->resetAfterTest(true); $generator = $this->getDataGenerator(); diff --git a/admin/tool/usertours/tests/step_test.php b/admin/tool/usertours/tests/step_test.php index 8ba2cafa2fa..530605ecb35 100644 --- a/admin/tool/usertours/tests/step_test.php +++ b/admin/tool/usertours/tests/step_test.php @@ -40,6 +40,7 @@ class step_test extends \advanced_testcase { */ public function setUp(): void { global $DB; + parent::setUp(); $this->db = $DB; } @@ -51,6 +52,7 @@ class step_test extends \advanced_testcase { global $DB; $DB = $this->db; + parent::tearDown(); } /** diff --git a/admin/tool/usertours/tests/tour_test.php b/admin/tool/usertours/tests/tour_test.php index e32df99a1f8..54d0165fa04 100644 --- a/admin/tool/usertours/tests/tour_test.php +++ b/admin/tool/usertours/tests/tour_test.php @@ -33,6 +33,7 @@ class tour_test extends \advanced_testcase { public static function setUpBeforeClass(): void { global $CFG; require_once($CFG->libdir . '/formslib.php'); + parent::setUpBeforeClass(); } /** @@ -40,6 +41,7 @@ class tour_test extends \advanced_testcase { */ public function setUp(): void { global $DB; + parent::setUp(); $this->db = $DB; } @@ -51,6 +53,7 @@ class tour_test extends \advanced_testcase { global $DB; $DB = $this->db; + parent::tearDown(); } /** diff --git a/analytics/tests/course_test.php b/analytics/tests/course_test.php index 9256b718cc0..e24d346f372 100644 --- a/analytics/tests/course_test.php +++ b/analytics/tests/course_test.php @@ -54,6 +54,7 @@ class course_test extends \advanced_testcase { public function setUp(): void { global $DB; + parent::setUp(); $this->course = $this->getDataGenerator()->create_course(['startdate' => 0]); $this->stu1 = $this->getDataGenerator()->create_user(); diff --git a/analytics/tests/dataset_manager_test.php b/analytics/tests/dataset_manager_test.php index 06235296c0c..f99a4b71a67 100644 --- a/analytics/tests/dataset_manager_test.php +++ b/analytics/tests/dataset_manager_test.php @@ -34,6 +34,7 @@ class dataset_manager_test extends \advanced_testcase { * @return null */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); $this->sharedtoprows = array( diff --git a/analytics/tests/model_test.php b/analytics/tests/model_test.php index 8320f8adcac..95f81f9be69 100644 --- a/analytics/tests/model_test.php +++ b/analytics/tests/model_test.php @@ -50,6 +50,7 @@ class model_test extends \advanced_testcase { protected $modelobj; public function setUp(): void { + parent::setUp(); $this->setAdminUser(); diff --git a/analytics/tests/prediction_actions_test.php b/analytics/tests/prediction_actions_test.php index ff17cebb6b2..a7cfa1eaaea 100644 --- a/analytics/tests/prediction_actions_test.php +++ b/analytics/tests/prediction_actions_test.php @@ -59,6 +59,7 @@ class prediction_actions_test extends \advanced_testcase { */ public function setUp(): void { global $DB; + parent::setUp(); $this->setAdminUser(); $target = \core_analytics\manager::get_target('test_target_shortname'); diff --git a/analytics/tests/prediction_test.php b/analytics/tests/prediction_test.php index 2f0750ddedc..c20d811ceac 100644 --- a/analytics/tests/prediction_test.php +++ b/analytics/tests/prediction_test.php @@ -63,6 +63,7 @@ class prediction_test extends \advanced_testcase { foreach ($models as $model) { $model->delete(); } + parent::tearDown(); } /** diff --git a/analytics/tests/privacy/provider_test.php b/analytics/tests/privacy/provider_test.php index 5bb2ea85903..83ca42b8948 100644 --- a/analytics/tests/privacy/provider_test.php +++ b/analytics/tests/privacy/provider_test.php @@ -88,6 +88,7 @@ class provider_test extends \core_privacy\tests\provider_testcase { protected $c2; public function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); $this->setAdminUser(); diff --git a/analytics/tests/stats_test.php b/analytics/tests/stats_test.php index 2d1a9278f59..901674d0903 100644 --- a/analytics/tests/stats_test.php +++ b/analytics/tests/stats_test.php @@ -35,6 +35,7 @@ class stats_test extends \advanced_testcase { * Set up the test environment. */ public function setUp(): void { + parent::setUp(); $this->setAdminUser(); } diff --git a/analytics/tests/time_splittings_test.php b/analytics/tests/time_splittings_test.php index 7228c9b5671..685001e3a33 100644 --- a/analytics/tests/time_splittings_test.php +++ b/analytics/tests/time_splittings_test.php @@ -47,6 +47,7 @@ class time_splittings_test extends \advanced_testcase { * @return void */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); diff --git a/auth/db/tests/db_test.php b/auth/db/tests/db_test.php index 981e56cf22e..64083bf1dc4 100644 --- a/auth/db/tests/db_test.php +++ b/auth/db/tests/db_test.php @@ -41,6 +41,7 @@ class db_test extends \advanced_testcase { sqlsrv_configure("LogSubsystems", SQLSRV_LOG_SYSTEM_OFF); sqlsrv_configure("LogSeverity", SQLSRV_LOG_SEVERITY_ERROR); } + parent::tearDownAfterClass(); } protected function init_auth_database() { diff --git a/auth/email/tests/external/external_test.php b/auth/email/tests/external/external_test.php index 5ba47583e0a..e52d96cfb8e 100644 --- a/auth/email/tests/external/external_test.php +++ b/auth/email/tests/external/external_test.php @@ -56,6 +56,7 @@ class external_test extends externallib_advanced_testcase { */ public function setUp(): void { global $CFG; + parent::setUp(); $this->resetAfterTest(true); $CFG->registerauth = 'email'; diff --git a/auth/lti/tests/privacy/provider_test.php b/auth/lti/tests/privacy/provider_test.php index d05b542b85d..ccc16d3d143 100644 --- a/auth/lti/tests/privacy/provider_test.php +++ b/auth/lti/tests/privacy/provider_test.php @@ -35,6 +35,7 @@ class provider_test extends provider_testcase { * Set up method. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); $this->setAdminUser(); } diff --git a/auth/manual/tests/manual_test.php b/auth/manual/tests/manual_test.php index 938d751eeb4..2624eccbb20 100644 --- a/auth/manual/tests/manual_test.php +++ b/auth/manual/tests/manual_test.php @@ -40,6 +40,7 @@ class manual_test extends \advanced_testcase { * Setup test data. */ protected function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); $this->authplugin = new auth_plugin_manual(); set_config('expiration', '1', 'auth_manual'); diff --git a/auth/manual/tests/privacy/provider_test.php b/auth/manual/tests/privacy/provider_test.php index 3e71f6fb29d..084df9efb76 100644 --- a/auth/manual/tests/privacy/provider_test.php +++ b/auth/manual/tests/privacy/provider_test.php @@ -47,6 +47,7 @@ class provider_test extends \core_privacy\tests\provider_testcase { * Basic setup for these tests. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); $this->authplugin = new \auth_plugin_manual(); } diff --git a/auth/mnet/tests/privacy/provider_test.php b/auth/mnet/tests/privacy/provider_test.php index 9a07caf9d67..8c232e785e1 100644 --- a/auth/mnet/tests/privacy/provider_test.php +++ b/auth/mnet/tests/privacy/provider_test.php @@ -45,6 +45,7 @@ class provider_test extends provider_testcase { * Set up method. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); $this->setAdminUser(); } diff --git a/auth/oauth2/tests/privacy/provider_test.php b/auth/oauth2/tests/privacy/provider_test.php index 05660cb84b8..8dbf3a2cf60 100644 --- a/auth/oauth2/tests/privacy/provider_test.php +++ b/auth/oauth2/tests/privacy/provider_test.php @@ -44,6 +44,7 @@ class provider_test extends provider_testcase { * Set up method. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); $this->setAdminUser(); } diff --git a/auth/tests/external/external_test.php b/auth/tests/external/external_test.php index 7e79a412f40..9f1d53f9ea5 100644 --- a/auth/tests/external/external_test.php +++ b/auth/tests/external/external_test.php @@ -55,6 +55,7 @@ class external_test extends externallib_advanced_testcase { */ public function setUp(): void { global $CFG; + parent::setUp(); $this->resetAfterTest(true); $CFG->registerauth = 'email'; diff --git a/auth/tests/privacy/provider_test.php b/auth/tests/privacy/provider_test.php index a0c5f3f73b8..365e8cf03d1 100644 --- a/auth/tests/privacy/provider_test.php +++ b/auth/tests/privacy/provider_test.php @@ -45,6 +45,7 @@ use core_auth\privacy\provider; class provider_test extends provider_testcase { public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); } diff --git a/availability/condition/completion/tests/condition_test.php b/availability/condition/completion/tests/condition_test.php index f36e36d4e5e..4610cb5065a 100644 --- a/availability/condition/completion/tests/condition_test.php +++ b/availability/condition/completion/tests/condition_test.php @@ -45,6 +45,7 @@ class condition_test extends \advanced_testcase { * Load required classes. */ public function setUp(): void { + parent::setUp(); condition::wipe_static_cache(); } diff --git a/availability/condition/date/tests/condition_test.php b/availability/condition/date/tests/condition_test.php index c28abe2b92c..e6cc10e021d 100644 --- a/availability/condition/date/tests/condition_test.php +++ b/availability/condition/date/tests/condition_test.php @@ -33,6 +33,7 @@ class condition_test extends \advanced_testcase { // Load the mock info class so that it can be used. global $CFG; require_once($CFG->dirroot . '/availability/tests/fixtures/mock_info.php'); + parent::setUp(); } /** diff --git a/availability/condition/group/tests/condition_test.php b/availability/condition/group/tests/condition_test.php index 96c20a92d82..ff8eea775d6 100644 --- a/availability/condition/group/tests/condition_test.php +++ b/availability/condition/group/tests/condition_test.php @@ -31,6 +31,7 @@ class condition_test extends \advanced_testcase { // Load the mock info class so that it can be used. global $CFG; require_once($CFG->dirroot . '/availability/tests/fixtures/mock_info.php'); + parent::setUp(); } /** diff --git a/availability/condition/grouping/tests/condition_test.php b/availability/condition/grouping/tests/condition_test.php index fa14191e8ba..c262d791c26 100644 --- a/availability/condition/grouping/tests/condition_test.php +++ b/availability/condition/grouping/tests/condition_test.php @@ -31,6 +31,7 @@ class condition_test extends \advanced_testcase { // Load the mock info class so that it can be used. global $CFG; require_once($CFG->dirroot . '/availability/tests/fixtures/mock_info.php'); + parent::setUp(); } /** diff --git a/availability/condition/profile/tests/condition_test.php b/availability/condition/profile/tests/condition_test.php index 6744c939294..18c47c630a7 100644 --- a/availability/condition/profile/tests/condition_test.php +++ b/availability/condition/profile/tests/condition_test.php @@ -37,6 +37,7 @@ class condition_test extends \advanced_testcase { public function setUp(): void { global $DB, $CFG; + parent::setUp(); $this->resetAfterTest(); diff --git a/availability/tests/info_test.php b/availability/tests/info_test.php index f2a5e9b7127..23a3ca80991 100644 --- a/availability/tests/info_test.php +++ b/availability/tests/info_test.php @@ -27,6 +27,7 @@ class info_test extends \advanced_testcase { public function setUp(): void { // Load the mock condition so that it can be used. require_once(__DIR__ . '/fixtures/mock_condition.php'); + parent::setUp(); } /** diff --git a/availability/tests/tree_test.php b/availability/tests/tree_test.php index 5972d30e908..6e9adb17955 100644 --- a/availability/tests/tree_test.php +++ b/availability/tests/tree_test.php @@ -28,6 +28,7 @@ class tree_test extends \advanced_testcase { // Load the mock classes so they can be used. require_once(__DIR__ . '/fixtures/mock_condition.php'); require_once(__DIR__ . '/fixtures/mock_info.php'); + parent::setUp(); } /** diff --git a/backup/controller/tests/controller_test.php b/backup/controller/tests/controller_test.php index 8c0ef914435..51dd167d5a1 100644 --- a/backup/controller/tests/controller_test.php +++ b/backup/controller/tests/controller_test.php @@ -51,6 +51,7 @@ class controller_test extends \advanced_testcase { protected function setUp(): void { global $DB, $CFG; + parent::setUp(); $this->resetAfterTest(true); diff --git a/backup/converter/moodle1/tests/moodle1_converter_test.php b/backup/converter/moodle1/tests/moodle1_converter_test.php index 245a53fbe40..b15a000f747 100644 --- a/backup/converter/moodle1/tests/moodle1_converter_test.php +++ b/backup/converter/moodle1/tests/moodle1_converter_test.php @@ -53,6 +53,7 @@ class moodle1_converter_test extends \advanced_testcase { protected function setUp(): void { global $CFG; + parent::setUp(); $this->tempdir = convert_helper::generate_id('unittest'); $this->tempdirpath = make_backup_temp_directory($this->tempdir); @@ -90,6 +91,7 @@ class moodle1_converter_test extends \advanced_testcase { if (empty($CFG->keeptempdirectoriesonbackup)) { fulldelete($this->tempdirpath); } + parent::tearDown(); } public function test_detect_format(): void { diff --git a/backup/moodle2/tests/backup_encrypted_content_test.php b/backup/moodle2/tests/backup_encrypted_content_test.php index 2c90f40bb0e..3a43652cbb1 100644 --- a/backup/moodle2/tests/backup_encrypted_content_test.php +++ b/backup/moodle2/tests/backup_encrypted_content_test.php @@ -37,6 +37,7 @@ require_once($CFG->dirroot . '/backup/moodle2/backup_custom_fields.php'); class backup_encrypted_content_test extends \advanced_testcase { public function setUp(): void { + parent::setUp(); if (!function_exists('openssl_encrypt')) { $this->markTestSkipped('OpenSSL extension is not loaded.'); diff --git a/backup/moodle2/tests/backup_stepslib_test.php b/backup/moodle2/tests/backup_stepslib_test.php index fe55452f00b..889509ff439 100644 --- a/backup/moodle2/tests/backup_stepslib_test.php +++ b/backup/moodle2/tests/backup_stepslib_test.php @@ -37,6 +37,7 @@ class backup_stepslib_test extends \advanced_testcase { require_once($CFG->dirroot . '/backup/util/includes/backup_includes.php'); require_once($CFG->dirroot . '/backup/util/includes/restore_includes.php'); require_once($CFG->dirroot . '/backup/moodle2/backup_stepslib.php'); + parent::setUpBeforeClass(); } /** diff --git a/backup/moodle2/tests/restore_stepslib_test.php b/backup/moodle2/tests/restore_stepslib_test.php index 3ffcbe6ae58..6a8eb5e162f 100644 --- a/backup/moodle2/tests/restore_stepslib_test.php +++ b/backup/moodle2/tests/restore_stepslib_test.php @@ -34,6 +34,7 @@ class restore_stepslib_test extends \advanced_testcase { require_once($CFG->dirroot . '/backup/util/includes/backup_includes.php'); require_once($CFG->dirroot . '/backup/util/includes/restore_includes.php'); require_once($CFG->dirroot . '/backup/moodle2/restore_stepslib.php'); + parent::setUpBeforeClass(); } /** diff --git a/backup/tests/automated_backup_test.php b/backup/tests/automated_backup_test.php index 3ad4d875be9..a63ee5d6b96 100644 --- a/backup/tests/automated_backup_test.php +++ b/backup/tests/automated_backup_test.php @@ -52,6 +52,7 @@ class automated_backup_test extends \advanced_testcase { protected function setUp(): void { global $DB, $CFG; + parent::setUp(); $this->resetAfterTest(true); $this->setAdminUser(); diff --git a/backup/tests/backup_cleanup_task_test.php b/backup/tests/backup_cleanup_task_test.php index 5ce2f404d6b..f32f7804348 100644 --- a/backup/tests/backup_cleanup_task_test.php +++ b/backup/tests/backup_cleanup_task_test.php @@ -34,6 +34,7 @@ class backup_cleanup_task_test extends \advanced_testcase { * Set up tasks for all tests. */ protected function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); } diff --git a/backup/tests/externallib_test.php b/backup/tests/externallib_test.php index 1318005da3f..b31748e716f 100644 --- a/backup/tests/externallib_test.php +++ b/backup/tests/externallib_test.php @@ -44,6 +44,7 @@ class externallib_test extends externallib_advanced_testcase { */ protected function setUp(): void { global $CFG; + parent::setUp(); $this->resetAfterTest(true); diff --git a/backup/util/helper/tests/copy_helper_test.php b/backup/util/helper/tests/copy_helper_test.php index 86cbd82c51d..4730ed13cec 100644 --- a/backup/util/helper/tests/copy_helper_test.php +++ b/backup/util/helper/tests/copy_helper_test.php @@ -65,6 +65,7 @@ class copy_helper_test extends \advanced_testcase { */ protected function setUp(): void { global $DB, $CFG, $USER; + parent::setUp(); $this->resetAfterTest(true); diff --git a/badges/tests/badgeslib_test.php b/badges/tests/badgeslib_test.php index fb7cf730770..9214ffaefb2 100644 --- a/badges/tests/badgeslib_test.php +++ b/badges/tests/badgeslib_test.php @@ -46,6 +46,7 @@ class badgeslib_test extends advanced_testcase { protected function setUp(): void { global $DB, $CFG; + parent::setUp(); $this->resetAfterTest(true); $CFG->enablecompletion = true; $user = $this->getDataGenerator()->create_user(); diff --git a/badges/tests/external/external_test.php b/badges/tests/external/external_test.php index 40d1c8736c1..e8e08654582 100644 --- a/badges/tests/external/external_test.php +++ b/badges/tests/external/external_test.php @@ -63,6 +63,7 @@ class external_test extends externallib_advanced_testcase { */ public function setUp(): void { global $DB; + parent::setUp(); $this->resetAfterTest(); $this->setAdminUser(); diff --git a/badges/tests/privacy/provider_test.php b/badges/tests/privacy/provider_test.php index 1bf4e80313b..37ebac2cf4f 100644 --- a/badges/tests/privacy/provider_test.php +++ b/badges/tests/privacy/provider_test.php @@ -50,6 +50,7 @@ require_once($CFG->libdir . '/badgeslib.php'); class provider_test extends provider_testcase { public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); } diff --git a/blocks/accessreview/tests/accessibility_review_test.php b/blocks/accessreview/tests/accessibility_review_test.php index 7b7e0335564..2b4efe2e4b9 100644 --- a/blocks/accessreview/tests/accessibility_review_test.php +++ b/blocks/accessreview/tests/accessibility_review_test.php @@ -34,6 +34,7 @@ class accessibility_review_test extends advanced_testcase { public static function setUpBeforeClass(): void { require_once(__DIR__ . '/../../moodleblock.class.php'); require_once(__DIR__ . '/../block_accessreview.php'); + parent::setUpBeforeClass(); } public function test_get_toggle_link(): void { diff --git a/blocks/badges/tests/badges_test.php b/blocks/badges/tests/badges_test.php index 2bd60e552f3..64cc50e1c93 100644 --- a/blocks/badges/tests/badges_test.php +++ b/blocks/badges/tests/badges_test.php @@ -33,6 +33,7 @@ class badges_test extends advanced_testcase { public static function setUpBeforeClass(): void { require_once(__DIR__ . '/../../moodleblock.class.php'); require_once(__DIR__ . '/../block_badges.php'); + parent::setUpBeforeClass(); } /** diff --git a/blocks/blog_menu/tests/blog_menu_test.php b/blocks/blog_menu/tests/blog_menu_test.php index be1d28e840e..6791ffa1e00 100644 --- a/blocks/blog_menu/tests/blog_menu_test.php +++ b/blocks/blog_menu/tests/blog_menu_test.php @@ -33,6 +33,7 @@ class blog_menu_test extends advanced_testcase { public static function setUpBeforeClass(): void { require_once(__DIR__ . '/../../moodleblock.class.php'); require_once(__DIR__ . '/../block_blog_menu.php'); + parent::setUpBeforeClass(); } /** diff --git a/blocks/blog_recent/tests/blog_recent_test.php b/blocks/blog_recent/tests/blog_recent_test.php index 6b69e6156bf..e857c5b5e3e 100644 --- a/blocks/blog_recent/tests/blog_recent_test.php +++ b/blocks/blog_recent/tests/blog_recent_test.php @@ -33,6 +33,7 @@ class blog_recent_test extends advanced_testcase { public static function setUpBeforeClass(): void { require_once(__DIR__ . '/../../moodleblock.class.php'); require_once(__DIR__ . '/../block_blog_recent.php'); + parent::setUpBeforeClass(); } /** diff --git a/blocks/blog_tags/tests/blog_tags_test.php b/blocks/blog_tags/tests/blog_tags_test.php index 6244e7def80..c348639223d 100644 --- a/blocks/blog_tags/tests/blog_tags_test.php +++ b/blocks/blog_tags/tests/blog_tags_test.php @@ -33,6 +33,7 @@ class blog_tags_test extends advanced_testcase { public static function setUpBeforeClass(): void { require_once(__DIR__ . '/../../moodleblock.class.php'); require_once(__DIR__ . '/../block_blog_tags.php'); + parent::setUpBeforeClass(); } /** diff --git a/blocks/comments/tests/comments_test.php b/blocks/comments/tests/comments_test.php index e19eb26e23d..1bdc94c5384 100644 --- a/blocks/comments/tests/comments_test.php +++ b/blocks/comments/tests/comments_test.php @@ -33,6 +33,7 @@ class comments_test extends advanced_testcase { public static function setUpBeforeClass(): void { require_once(__DIR__ . '/../../moodleblock.class.php'); require_once(__DIR__ . '/../block_comments.php'); + parent::setUpBeforeClass(); } /** diff --git a/blocks/comments/tests/event/events_test.php b/blocks/comments/tests/event/events_test.php index 3f74870b51e..be09263df2f 100644 --- a/blocks/comments/tests/event/events_test.php +++ b/blocks/comments/tests/event/events_test.php @@ -44,6 +44,7 @@ class events_test extends \advanced_testcase { * Setup test data. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); $this->setAdminUser(); diff --git a/blocks/comments/tests/privacy/provider_test.php b/blocks/comments/tests/privacy/provider_test.php index 49d13103612..86c53d0f8ce 100644 --- a/blocks/comments/tests/privacy/provider_test.php +++ b/blocks/comments/tests/privacy/provider_test.php @@ -55,6 +55,7 @@ class provider_test extends \core_privacy\tests\provider_testcase { protected function setUp(): void { global $DB; + parent::setUp(); $this->resetAfterTest(); $this->setAdminUser(); diff --git a/blocks/completionstatus/tests/completionstatus_test.php b/blocks/completionstatus/tests/completionstatus_test.php index deb92674091..07e3ebff39b 100644 --- a/blocks/completionstatus/tests/completionstatus_test.php +++ b/blocks/completionstatus/tests/completionstatus_test.php @@ -33,6 +33,7 @@ class completionstatus_test extends advanced_testcase { public static function setUpBeforeClass(): void { require_once(__DIR__ . '/../../moodleblock.class.php'); require_once(__DIR__ . '/../block_completionstatus.php'); + parent::setUpBeforeClass(); } /** diff --git a/blocks/globalsearch/tests/globalsearch_test.php b/blocks/globalsearch/tests/globalsearch_test.php index 29e438824aa..43950b3019b 100644 --- a/blocks/globalsearch/tests/globalsearch_test.php +++ b/blocks/globalsearch/tests/globalsearch_test.php @@ -33,6 +33,7 @@ class globalsearch_test extends advanced_testcase { public static function setUpBeforeClass(): void { require_once(__DIR__ . '/../../moodleblock.class.php'); require_once(__DIR__ . '/../block_globalsearch.php'); + parent::setUpBeforeClass(); } /** diff --git a/blocks/glossary_random/tests/glossary_random_test.php b/blocks/glossary_random/tests/glossary_random_test.php index 08b07821ceb..50ef730b8f2 100644 --- a/blocks/glossary_random/tests/glossary_random_test.php +++ b/blocks/glossary_random/tests/glossary_random_test.php @@ -33,6 +33,7 @@ class glossary_random_test extends advanced_testcase { public static function setUpBeforeClass(): void { require_once(__DIR__ . '/../../moodleblock.class.php'); require_once(__DIR__ . '/../block_glossary_random.php'); + parent::setUpBeforeClass(); } /** diff --git a/blocks/lp/tests/lp_test.php b/blocks/lp/tests/lp_test.php index d93d91c0521..72fdfee20e7 100644 --- a/blocks/lp/tests/lp_test.php +++ b/blocks/lp/tests/lp_test.php @@ -33,6 +33,7 @@ class lp_test extends advanced_testcase { public static function setUpBeforeClass(): void { require_once(__DIR__ . '/../../moodleblock.class.php'); require_once(__DIR__ . '/../block_lp.php'); + parent::setUpBeforeClass(); } /** diff --git a/blocks/mnet_hosts/tests/mnet_hosts_test.php b/blocks/mnet_hosts/tests/mnet_hosts_test.php index a15a2ec8d35..1baffbd2ac0 100644 --- a/blocks/mnet_hosts/tests/mnet_hosts_test.php +++ b/blocks/mnet_hosts/tests/mnet_hosts_test.php @@ -33,6 +33,7 @@ class mnet_hosts_test extends advanced_testcase { public static function setUpBeforeClass(): void { require_once(__DIR__ . '/../../moodleblock.class.php'); require_once(__DIR__ . '/../block_mnet_hosts.php'); + parent::setUpBeforeClass(); } /** diff --git a/blocks/online_users/tests/online_users_test.php b/blocks/online_users/tests/online_users_test.php index 3a38bf5ae9c..9793bb0bc02 100644 --- a/blocks/online_users/tests/online_users_test.php +++ b/blocks/online_users/tests/online_users_test.php @@ -36,6 +36,7 @@ class online_users_test extends \advanced_testcase { * simulate various recent accesses. */ protected function setUp(): void { + parent::setUp(); // Generate (simulated) recently logged-in users. $generator = $this->getDataGenerator()->get_plugin_generator('block_online_users'); diff --git a/blocks/recentlyaccesseditems/tests/observer_test.php b/blocks/recentlyaccesseditems/tests/observer_test.php index c6bff27502d..c866c497906 100644 --- a/blocks/recentlyaccesseditems/tests/observer_test.php +++ b/blocks/recentlyaccesseditems/tests/observer_test.php @@ -64,6 +64,7 @@ class observer_test extends \advanced_testcase { */ public function setUp(): void { global $DB; + parent::setUp(); $this->resetAfterTest(); $this->setAdminUser(); diff --git a/blocks/rss_client/tests/privacy/provider_test.php b/blocks/rss_client/tests/privacy/provider_test.php index 7ec3f3e0c7a..dd60d909273 100644 --- a/blocks/rss_client/tests/privacy/provider_test.php +++ b/blocks/rss_client/tests/privacy/provider_test.php @@ -40,6 +40,7 @@ class provider_test extends provider_testcase { * Basic setup for these tests. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); } diff --git a/blocks/tags/tests/tags_test.php b/blocks/tags/tests/tags_test.php index 4c69a5870c2..cc95d99ca11 100644 --- a/blocks/tags/tests/tags_test.php +++ b/blocks/tags/tests/tags_test.php @@ -33,6 +33,7 @@ class tags_test extends advanced_testcase { public static function setUpBeforeClass(): void { require_once(__DIR__ . '/../../moodleblock.class.php'); require_once(__DIR__ . '/../block_tags.php'); + parent::setUpBeforeClass(); } /** diff --git a/blocks/tests/privacy/provider_test.php b/blocks/tests/privacy/provider_test.php index 1f142795c6c..c27d83d6bba 100644 --- a/blocks/tests/privacy/provider_test.php +++ b/blocks/tests/privacy/provider_test.php @@ -46,6 +46,7 @@ use core_block\privacy\provider; class provider_test extends provider_testcase { public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); } diff --git a/blog/tests/privacy/provider_test.php b/blog/tests/privacy/provider_test.php index 05d1e6594e8..f7b22d0e967 100644 --- a/blog/tests/privacy/provider_test.php +++ b/blog/tests/privacy/provider_test.php @@ -49,6 +49,7 @@ require_once($CFG->dirroot . '/comment/lib.php'); class provider_test extends provider_testcase { public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); } diff --git a/cache/stores/redis/tests/cachestore_cluster_redis_test.php b/cache/stores/redis/tests/cachestore_cluster_redis_test.php index 604b122bea5..05013afb794 100644 --- a/cache/stores/redis/tests/cachestore_cluster_redis_test.php +++ b/cache/stores/redis/tests/cachestore_cluster_redis_test.php @@ -88,6 +88,7 @@ class cachestore_cluster_redis_test extends \advanced_testcase { * Set up the test environment. */ public function setUp(): void { + parent::setUp(); if (!cachestore_redis::are_requirements_met()) { $this->markTestSkipped('Could not test cachestore_redis with cluster, missing requirements.'); } else if (!\cache_helper::is_cluster_available()) { diff --git a/cache/tests/cache_test.php b/cache/tests/cache_test.php index a5b06f9e293..142b11cf2fa 100644 --- a/cache/tests/cache_test.php +++ b/cache/tests/cache_test.php @@ -63,6 +63,7 @@ class cache_test extends \advanced_testcase { require_once($CFG->dirroot . '/cache/locallib.php'); require_once($CFG->dirroot . '/cache/tests/fixtures/lib.php'); require_once($CFG->dirroot . '/cache/tests/fixtures/cache_phpunit_dummy_datasource_versionable.php'); + parent::setUpBeforeClass(); } /** diff --git a/calendar/tests/calendartype_test.php b/calendar/tests/calendartype_test.php index 428aebbd9b2..5ed64b18cda 100644 --- a/calendar/tests/calendartype_test.php +++ b/calendar/tests/calendartype_test.php @@ -60,6 +60,7 @@ class calendartype_test extends \advanced_testcase { * Test set up. */ protected function setUp(): void { + parent::setUp(); // The user we are going to test this on. $this->user = self::getDataGenerator()->create_user(); self::setUser($this->user); diff --git a/calendar/tests/container_test.php b/calendar/tests/container_test.php index 00a9f8badf2..8a69a478bbf 100644 --- a/calendar/tests/container_test.php +++ b/calendar/tests/container_test.php @@ -44,6 +44,7 @@ class container_test extends \advanced_testcase { * Test setup. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); $this->setAdminUser(); } diff --git a/calendar/tests/event/events_test.php b/calendar/tests/event/events_test.php index 73214109eed..b598760607e 100644 --- a/calendar/tests/event/events_test.php +++ b/calendar/tests/event/events_test.php @@ -54,6 +54,7 @@ class events_test extends \advanced_testcase { */ protected function setUp(): void { global $USER; + parent::setUp(); // The user we are going to test this on. $this->setAdminUser(); $this->user = $USER; diff --git a/calendar/tests/events_related_objects_cache_test.php b/calendar/tests/events_related_objects_cache_test.php index 8ed622c8fd1..55196bc9e7d 100644 --- a/calendar/tests/events_related_objects_cache_test.php +++ b/calendar/tests/events_related_objects_cache_test.php @@ -36,6 +36,7 @@ class events_related_objects_cache_test extends \advanced_testcase { * Tests set up */ protected function setUp(): void { + parent::setUp(); $this->resetAfterTest(); } diff --git a/calendar/tests/externallib_test.php b/calendar/tests/externallib_test.php index e987aaa7eac..02b9c47a4bc 100644 --- a/calendar/tests/externallib_test.php +++ b/calendar/tests/externallib_test.php @@ -43,6 +43,7 @@ class externallib_test extends externallib_advanced_testcase { protected function setUp(): void { global $CFG; require_once($CFG->dirroot . '/calendar/externallib.php'); + parent::setUp(); } /** Create calendar events or update them diff --git a/calendar/tests/lib_test.php b/calendar/tests/lib_test.php index e23396c6640..b9ddfe94b58 100644 --- a/calendar/tests/lib_test.php +++ b/calendar/tests/lib_test.php @@ -32,12 +32,14 @@ class lib_test extends \advanced_testcase { global $CFG; require_once("{$CFG->dirroot}/calendar/tests/helpers.php"); + parent::setUpBeforeClass(); } /** * Tests set up */ protected function setUp(): void { + parent::setUp(); $this->resetAfterTest(); } diff --git a/calendar/tests/local_api_test.php b/calendar/tests/local_api_test.php index e1f3e503890..def62f7834e 100644 --- a/calendar/tests/local_api_test.php +++ b/calendar/tests/local_api_test.php @@ -36,6 +36,7 @@ class local_api_test extends \advanced_testcase { * Tests set up */ protected function setUp(): void { + parent::setUp(); $this->resetAfterTest(); } diff --git a/calendar/tests/privacy/provider_test.php b/calendar/tests/privacy/provider_test.php index b468df121de..03929dc787e 100644 --- a/calendar/tests/privacy/provider_test.php +++ b/calendar/tests/privacy/provider_test.php @@ -50,6 +50,7 @@ class provider_test extends provider_testcase { * Overriding setUp() function to always reset after tests. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); } diff --git a/calendar/tests/rrule_manager_test.php b/calendar/tests/rrule_manager_test.php index 2e904ac9689..a09e727731d 100644 --- a/calendar/tests/rrule_manager_test.php +++ b/calendar/tests/rrule_manager_test.php @@ -39,6 +39,7 @@ class rrule_manager_test extends \advanced_testcase { */ protected function setUp(): void { global $DB; + parent::setUp(); $this->resetAfterTest(); // Set our timezone based on the timezone in the RFC's samples (US/Eastern). diff --git a/calendar/tests/std_proxy_test.php b/calendar/tests/std_proxy_test.php index af3080df979..2dc7028848a 100644 --- a/calendar/tests/std_proxy_test.php +++ b/calendar/tests/std_proxy_test.php @@ -32,6 +32,7 @@ class std_proxy_test extends \advanced_testcase { public $objects; public function setUp(): void { + parent::setUp(); $this->objects = [ 1 => (object) [ 'member1' => 'Hello', diff --git a/cohort/tests/customfield/cohort_handler_test.php b/cohort/tests/customfield/cohort_handler_test.php index 87ea881d02d..81350f2e4b9 100644 --- a/cohort/tests/customfield/cohort_handler_test.php +++ b/cohort/tests/customfield/cohort_handler_test.php @@ -41,6 +41,7 @@ class cohort_handler_test extends advanced_testcase { * Setup. */ public function setUp(): void { + parent::setUp(); $this->handler = cohort_handler::create(); } diff --git a/cohort/tests/privacy/provider_test.php b/cohort/tests/privacy/provider_test.php index 85099a7c599..07e4188e426 100644 --- a/cohort/tests/privacy/provider_test.php +++ b/cohort/tests/privacy/provider_test.php @@ -44,6 +44,7 @@ class provider_test extends provider_testcase { * Basic setup for these tests. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); } diff --git a/comment/tests/externallib_test.php b/comment/tests/externallib_test.php index dd9abf52d51..31a8b0a59c0 100644 --- a/comment/tests/externallib_test.php +++ b/comment/tests/externallib_test.php @@ -42,6 +42,7 @@ class externallib_test extends externallib_advanced_testcase { * Tests set up */ protected function setUp(): void { + parent::setUp(); $this->resetAfterTest(); } diff --git a/comment/tests/privacy/provider_test.php b/comment/tests/privacy/provider_test.php index 088ac4894d0..7f703907261 100644 --- a/comment/tests/privacy/provider_test.php +++ b/comment/tests/privacy/provider_test.php @@ -42,6 +42,7 @@ use core_privacy\tests\request\approved_contextlist; class provider_test extends provider_testcase { protected function setUp(): void { + parent::setUp(); $this->resetAfterTest(); } diff --git a/competency/tests/competency_override_test.php b/competency/tests/competency_override_test.php index d4296d0d3b8..15b908d474e 100644 --- a/competency/tests/competency_override_test.php +++ b/competency/tests/competency_override_test.php @@ -56,6 +56,7 @@ class competency_override_test extends \advanced_testcase { protected $context; public function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); $this->setAdminUser(); $dg = $this->getDataGenerator(); diff --git a/competency/tests/external/external_test.php b/competency/tests/external/external_test.php index 2cfc7119146..b30a9335a8b 100644 --- a/competency/tests/external/external_test.php +++ b/competency/tests/external/external_test.php @@ -105,6 +105,7 @@ class external_test extends externallib_advanced_testcase { */ protected function setUp(): void { global $DB, $CFG; + parent::setUp(); $this->resetAfterTest(true); diff --git a/competency/tests/privacy/provider_test.php b/competency/tests/privacy/provider_test.php index dff9fe5cf1d..f64a4d182c6 100644 --- a/competency/tests/privacy/provider_test.php +++ b/competency/tests/privacy/provider_test.php @@ -52,6 +52,7 @@ class provider_test extends provider_testcase { public function setUp(): void { global $PAGE; + parent::setUp(); $this->resetAfterTest(); // We need this or exporters (core\external\exporter) do not receive the right renderer. diff --git a/completion/tests/api_test.php b/completion/tests/api_test.php index 4e9d5b510fd..230d379d2a8 100644 --- a/completion/tests/api_test.php +++ b/completion/tests/api_test.php @@ -30,6 +30,7 @@ class api_test extends \advanced_testcase { * Test setup. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); } diff --git a/completion/tests/completion_criteria_test.php b/completion/tests/completion_criteria_test.php index 7061d7e86e7..4fbdb38d98f 100644 --- a/completion/tests/completion_criteria_test.php +++ b/completion/tests/completion_criteria_test.php @@ -36,6 +36,7 @@ class completion_criteria_test extends \advanced_testcase { require_once($CFG->dirroot.'/completion/criteria/completion_criteria_duration.php'); require_once($CFG->dirroot.'/completion/criteria/completion_criteria_grade.php'); require_once($CFG->dirroot.'/completion/criteria/completion_criteria_date.php'); + parent::setUp(); $this->setAdminUser(); $this->resetAfterTest(); diff --git a/completion/tests/progress_test.php b/completion/tests/progress_test.php index c46341723ef..d4cfa6fc830 100644 --- a/completion/tests/progress_test.php +++ b/completion/tests/progress_test.php @@ -33,6 +33,7 @@ class progress_test extends \advanced_testcase { */ public function setUp(): void { global $CFG; + parent::setUp(); $CFG->enablecompletion = true; $this->resetAfterTest(); diff --git a/course/format/tests/external/get_state_test.php b/course/format/tests/external/get_state_test.php index a01e5518709..3fd456a24e4 100644 --- a/course/format/tests/external/get_state_test.php +++ b/course/format/tests/external/get_state_test.php @@ -55,6 +55,7 @@ class get_state_test extends \externallib_advanced_testcase { * Setup testcase. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); $this->sections = []; @@ -67,6 +68,7 @@ class get_state_test extends \externallib_advanced_testcase { public function tearDown(): void { unset($this->sections); unset($this->activities); + parent::tearDown(); } /** diff --git a/course/format/tests/formatactions_test.php b/course/format/tests/formatactions_test.php index ec0b4e77296..f949099fb11 100644 --- a/course/format/tests/formatactions_test.php +++ b/course/format/tests/formatactions_test.php @@ -35,6 +35,7 @@ class formatactions_test extends \advanced_testcase { require_once($CFG->dirroot . '/course/format/tests/fixtures/format_theunittest_courseactions.php'); require_once($CFG->dirroot . '/course/format/tests/fixtures/format_theunittest_sectionactions.php'); require_once($CFG->dirroot . '/course/format/tests/fixtures/format_theunittest_cmactions.php'); + parent::setUpBeforeClass(); } /** diff --git a/course/format/tests/local/baseactions_test.php b/course/format/tests/local/baseactions_test.php index 19d05e14332..63a748d8249 100644 --- a/course/format/tests/local/baseactions_test.php +++ b/course/format/tests/local/baseactions_test.php @@ -34,6 +34,7 @@ class baseactions_test extends \advanced_testcase { public static function setUpBeforeClass(): void { global $CFG; require_once($CFG->dirroot . '/course/lib.php'); + parent::setUpBeforeClass(); } /** diff --git a/course/format/tests/local/cmactions_test.php b/course/format/tests/local/cmactions_test.php index 53057795240..e84a2de12d0 100644 --- a/course/format/tests/local/cmactions_test.php +++ b/course/format/tests/local/cmactions_test.php @@ -33,6 +33,7 @@ final class cmactions_test extends \advanced_testcase { public static function setUpBeforeClass(): void { global $CFG; require_once($CFG->dirroot . '/course/lib.php'); + parent::setUpBeforeClass(); } /** diff --git a/course/format/tests/local/sectionactions_test.php b/course/format/tests/local/sectionactions_test.php index 5c6cee52143..8f663348cf1 100644 --- a/course/format/tests/local/sectionactions_test.php +++ b/course/format/tests/local/sectionactions_test.php @@ -33,6 +33,7 @@ class sectionactions_test extends \advanced_testcase { public static function setUpBeforeClass(): void { global $CFG; require_once($CFG->dirroot . '/course/lib.php'); + parent::setUpBeforeClass(); } /** diff --git a/course/format/tests/sectiondelegate_test.php b/course/format/tests/sectiondelegate_test.php index bbd585c4b3b..36c32bc266f 100644 --- a/course/format/tests/sectiondelegate_test.php +++ b/course/format/tests/sectiondelegate_test.php @@ -35,6 +35,7 @@ class sectiondelegate_test extends \advanced_testcase { public static function setUpBeforeClass(): void { global $CFG; require_once($CFG->libdir . '/tests/fixtures/sectiondelegatetest.php'); + parent::setUpBeforeClass(); } /** diff --git a/course/format/weeks/tests/observer_test.php b/course/format/weeks/tests/observer_test.php index ada26d82c15..d3122db32cc 100644 --- a/course/format/weeks/tests/observer_test.php +++ b/course/format/weeks/tests/observer_test.php @@ -29,6 +29,7 @@ class observer_test extends \advanced_testcase { * Test setup. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); } diff --git a/course/tests/backup_restore_activity_test.php b/course/tests/backup_restore_activity_test.php index 8ccae92b447..f0d2a65fa01 100644 --- a/course/tests/backup_restore_activity_test.php +++ b/course/tests/backup_restore_activity_test.php @@ -34,6 +34,7 @@ class backup_restore_activity_test extends \advanced_testcase { global $CFG; require_once($CFG->dirroot . '/backup/util/includes/restore_includes.php'); require_once($CFG->dirroot . '/backup/util/includes/backup_includes.php'); + parent::setUpBeforeClass(); } /** diff --git a/course/tests/category_hooks_test.php b/course/tests/category_hooks_test.php index ae80fa283c7..1640e6b4995 100644 --- a/course/tests/category_hooks_test.php +++ b/course/tests/category_hooks_test.php @@ -39,6 +39,7 @@ use core_course\test\mock_hooks; class category_hooks_test extends \advanced_testcase { protected function setUp(): void { + parent::setUp(); $this->resetAfterTest(); $this->setAdminUser(); } diff --git a/course/tests/courselib_test.php b/course/tests/courselib_test.php index 45338180d38..f811ec9ac6b 100644 --- a/course/tests/courselib_test.php +++ b/course/tests/courselib_test.php @@ -74,6 +74,7 @@ class courselib_test extends advanced_testcase { require_once($CFG->dirroot . '/course/tests/fixtures/course_capability_assignment.php'); require_once($CFG->dirroot . '/enrol/imsenterprise/tests/imsenterprise_test.php'); + parent::setUpBeforeClass(); } /** diff --git a/course/tests/event/events_test.php b/course/tests/event/events_test.php index ea373a9943b..77d895cdcca 100644 --- a/course/tests/event/events_test.php +++ b/course/tests/event/events_test.php @@ -39,6 +39,7 @@ class events_test extends \advanced_testcase { protected function setUp(): void { global $CFG; require_once($CFG->dirroot . '/course/lib.php'); + parent::setUp(); $this->resetAfterTest(); } diff --git a/course/tests/externallib_test.php b/course/tests/externallib_test.php index 606af80929c..89959169394 100644 --- a/course/tests/externallib_test.php +++ b/course/tests/externallib_test.php @@ -48,6 +48,7 @@ class externallib_test extends externallib_advanced_testcase { protected function setUp(): void { global $CFG; require_once($CFG->dirroot . '/course/externallib.php'); + parent::setUp(); } /** diff --git a/course/tests/reportbuilder/datasource/participants_test.php b/course/tests/reportbuilder/datasource/participants_test.php index a183b06e5d2..6b68aab142c 100644 --- a/course/tests/reportbuilder/datasource/participants_test.php +++ b/course/tests/reportbuilder/datasource/participants_test.php @@ -53,6 +53,7 @@ final class participants_test extends core_reportbuilder_testcase { require_once("{$CFG->libdir}/gradelib.php"); require_once("{$CFG->dirroot}/completion/criteria/completion_criteria_self.php"); + parent::setUpBeforeClass(); } /** diff --git a/course/tests/search/search_test.php b/course/tests/search/search_test.php index 5149f5c6ee3..fe8ab3ee5cc 100644 --- a/course/tests/search/search_test.php +++ b/course/tests/search/search_test.php @@ -56,6 +56,7 @@ class search_test extends \advanced_testcase { protected $customfieldareaid = null; public function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); set_config('enableglobalsearch', true); diff --git a/customfield/field/checkbox/tests/plugin_test.php b/customfield/field/checkbox/tests/plugin_test.php index aa4d79c5f52..273be62d325 100644 --- a/customfield/field/checkbox/tests/plugin_test.php +++ b/customfield/field/checkbox/tests/plugin_test.php @@ -41,6 +41,7 @@ class plugin_test extends \advanced_testcase { * Tests set up. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); $this->cfcat = $this->get_generator()->create_category(); diff --git a/customfield/field/date/tests/plugin_test.php b/customfield/field/date/tests/plugin_test.php index cf01a554a7b..2a19f0e7020 100644 --- a/customfield/field/date/tests/plugin_test.php +++ b/customfield/field/date/tests/plugin_test.php @@ -41,6 +41,7 @@ class plugin_test extends \advanced_testcase { * Tests set up. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); $this->cfcat = $this->get_generator()->create_category(); diff --git a/customfield/field/select/tests/plugin_test.php b/customfield/field/select/tests/plugin_test.php index 337d9410b52..e2b83988cc7 100644 --- a/customfield/field/select/tests/plugin_test.php +++ b/customfield/field/select/tests/plugin_test.php @@ -41,6 +41,7 @@ class plugin_test extends \advanced_testcase { * Tests set up. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); $this->cfcat = $this->get_generator()->create_category(); diff --git a/customfield/field/text/tests/plugin_test.php b/customfield/field/text/tests/plugin_test.php index a26406b645f..08ebedba0b2 100644 --- a/customfield/field/text/tests/plugin_test.php +++ b/customfield/field/text/tests/plugin_test.php @@ -41,6 +41,7 @@ class plugin_test extends \advanced_testcase { * Tests set up. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); $this->cfcat = $this->get_generator()->create_category(); diff --git a/customfield/field/textarea/tests/plugin_test.php b/customfield/field/textarea/tests/plugin_test.php index 8565791a318..40ebf44e271 100644 --- a/customfield/field/textarea/tests/plugin_test.php +++ b/customfield/field/textarea/tests/plugin_test.php @@ -46,6 +46,7 @@ class plugin_test extends \advanced_testcase { * Tests set up. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); $this->cfcat = $this->get_generator()->create_category(); diff --git a/enrol/database/tests/lib_test.php b/enrol/database/tests/lib_test.php index 94c1467d65a..4faf1e91485 100644 --- a/enrol/database/tests/lib_test.php +++ b/enrol/database/tests/lib_test.php @@ -46,6 +46,7 @@ class lib_test extends \advanced_testcase { sqlsrv_configure("LogSubsystems", SQLSRV_LOG_SYSTEM_OFF); sqlsrv_configure("LogSeverity", SQLSRV_LOG_SEVERITY_ERROR); } + parent::tearDownAfterClass(); } /** diff --git a/enrol/database/tests/sync_test.php b/enrol/database/tests/sync_test.php index dc80e55eae1..4b98153eafc 100644 --- a/enrol/database/tests/sync_test.php +++ b/enrol/database/tests/sync_test.php @@ -44,6 +44,7 @@ class sync_test extends \advanced_testcase { sqlsrv_configure("LogSubsystems", SQLSRV_LOG_SYSTEM_OFF); sqlsrv_configure("LogSeverity", SQLSRV_LOG_SEVERITY_ERROR); } + parent::tearDownAfterClass(); } protected function init_enrol_database() { diff --git a/enrol/flatfile/tests/privacy/provider_test.php b/enrol/flatfile/tests/privacy/provider_test.php index 4908c2f4703..0cf0bd5117e 100644 --- a/enrol/flatfile/tests/privacy/provider_test.php +++ b/enrol/flatfile/tests/privacy/provider_test.php @@ -65,6 +65,7 @@ class provider_test extends provider_testcase { * Called before every test. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); } diff --git a/enrol/imsenterprise/tests/imsenterprise_test.php b/enrol/imsenterprise/tests/imsenterprise_test.php index 9b72944073d..3e98902a789 100644 --- a/enrol/imsenterprise/tests/imsenterprise_test.php +++ b/enrol/imsenterprise/tests/imsenterprise_test.php @@ -44,6 +44,7 @@ class imsenterprise_test extends \advanced_testcase { * Setup required for all tests. */ protected function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); $this->imsplugin = enrol_get_plugin('imsenterprise'); $this->set_test_config(); diff --git a/enrol/imsenterprise/tests/imsenterprise_unenrol_test.php b/enrol/imsenterprise/tests/imsenterprise_unenrol_test.php index 33d4760bd0e..76344d13bf0 100644 --- a/enrol/imsenterprise/tests/imsenterprise_unenrol_test.php +++ b/enrol/imsenterprise/tests/imsenterprise_unenrol_test.php @@ -47,6 +47,7 @@ class imsenterprise_unenrol_test extends \advanced_testcase { * Setup required for all tests. */ protected function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); $this->imsplugin = enrol_get_plugin('imsenterprise'); $this->set_test_config(); diff --git a/enrol/lti/tests/data_connector_test.php b/enrol/lti/tests/data_connector_test.php index 5707a22a434..b8fd6cb6943 100644 --- a/enrol/lti/tests/data_connector_test.php +++ b/enrol/lti/tests/data_connector_test.php @@ -42,6 +42,7 @@ class data_connector_test extends \advanced_testcase { * This is executed before running any test in this file. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); // Set this user as the admin. diff --git a/enrol/lti/tests/helper_test.php b/enrol/lti/tests/helper_test.php index e1e99fdb6c6..367feec0904 100644 --- a/enrol/lti/tests/helper_test.php +++ b/enrol/lti/tests/helper_test.php @@ -41,6 +41,7 @@ class helper_test extends \advanced_testcase { * This is executed before running any test in this file. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); // Set this user as the admin. diff --git a/enrol/lti/tests/lib_test.php b/enrol/lti/tests/lib_test.php index ef378a0f87d..f1cac91f132 100644 --- a/enrol/lti/tests/lib_test.php +++ b/enrol/lti/tests/lib_test.php @@ -49,6 +49,7 @@ class lib_test extends \lti_advantage_testcase { * This is executed before running any tests in this file. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); $this->setAdminUser(); } diff --git a/enrol/lti/tests/local/ltiadvantage/entity/migration_claim_test.php b/enrol/lti/tests/local/ltiadvantage/entity/migration_claim_test.php index e04f55e9559..4fd9fd6e295 100644 --- a/enrol/lti/tests/local/ltiadvantage/entity/migration_claim_test.php +++ b/enrol/lti/tests/local/ltiadvantage/entity/migration_claim_test.php @@ -31,6 +31,7 @@ class migration_claim_test extends \advanced_testcase { * Setup run for each test case. */ protected function setUp(): void { + parent::setUp(); $this->resetAfterTest(); } diff --git a/enrol/lti/tests/privacy/provider_test.php b/enrol/lti/tests/privacy/provider_test.php index 2b79eac69e0..92130b14866 100644 --- a/enrol/lti/tests/privacy/provider_test.php +++ b/enrol/lti/tests/privacy/provider_test.php @@ -61,6 +61,7 @@ class provider_test extends \core_privacy\tests\provider_testcase { * Basic setup for these tests. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); $this->course = $this->getDataGenerator()->create_course(); diff --git a/enrol/lti/tests/sync_members_test.php b/enrol/lti/tests/sync_members_test.php index 6705efe88aa..446989d6bbc 100644 --- a/enrol/lti/tests/sync_members_test.php +++ b/enrol/lti/tests/sync_members_test.php @@ -59,6 +59,7 @@ class sync_members_test extends \advanced_testcase { protected $resourcelink; public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); // Set this user as the admin. diff --git a/enrol/lti/tests/tool_provider_test.php b/enrol/lti/tests/tool_provider_test.php index 7d8754614a0..aeae5586070 100644 --- a/enrol/lti/tests/tool_provider_test.php +++ b/enrol/lti/tests/tool_provider_test.php @@ -54,6 +54,7 @@ class tool_provider_test extends \advanced_testcase { */ public function setUp(): void { global $SESSION; + parent::setUp(); $this->resetAfterTest(); manager::init_empty_session(); diff --git a/enrol/meta/tests/external/add_instances_test.php b/enrol/meta/tests/external/add_instances_test.php index 4ccb82c4207..83596017eb6 100644 --- a/enrol/meta/tests/external/add_instances_test.php +++ b/enrol/meta/tests/external/add_instances_test.php @@ -37,6 +37,7 @@ class add_instances_test extends \externallib_advanced_testcase { * Test setup */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); $this->setAdminUser(); } diff --git a/enrol/meta/tests/external/delete_instances_test.php b/enrol/meta/tests/external/delete_instances_test.php index 723c2d74e84..1a52d6795e6 100644 --- a/enrol/meta/tests/external/delete_instances_test.php +++ b/enrol/meta/tests/external/delete_instances_test.php @@ -37,6 +37,7 @@ class delete_instances_test extends \externallib_advanced_testcase { * Test setup */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); $this->setAdminUser(); } diff --git a/enrol/paypal/tests/privacy/provider_test.php b/enrol/paypal/tests/privacy/provider_test.php index 107faa0b121..b405c8dd5db 100644 --- a/enrol/paypal/tests/privacy/provider_test.php +++ b/enrol/paypal/tests/privacy/provider_test.php @@ -83,6 +83,7 @@ class provider_test extends \core_privacy\tests\provider_testcase { protected function setUp(): void { global $DB; + parent::setUp(); $this->resetAfterTest(); diff --git a/enrol/tests/course_enrolment_manager_test.php b/enrol/tests/course_enrolment_manager_test.php index 9b54fc14e52..7785fce81f0 100644 --- a/enrol/tests/course_enrolment_manager_test.php +++ b/enrol/tests/course_enrolment_manager_test.php @@ -52,6 +52,7 @@ class course_enrolment_manager_test extends \advanced_testcase { protected function setUp(): void { global $CFG; require_once($CFG->dirroot . '/enrol/locallib.php'); + parent::setUp(); $this->setAdminUser(); $users = array(); diff --git a/enrol/tests/role_external_test.php b/enrol/tests/role_external_test.php index 0942a504f19..25649557f21 100644 --- a/enrol/tests/role_external_test.php +++ b/enrol/tests/role_external_test.php @@ -40,6 +40,7 @@ class role_external_test extends \externallib_advanced_testcase { protected function setUp(): void { global $CFG; require_once($CFG->dirroot . '/enrol/externallib.php'); + parent::setUp(); } /** diff --git a/favourites/tests/component_favourite_service_test.php b/favourites/tests/component_favourite_service_test.php index e95e50bba8d..8ccb52c8b2d 100644 --- a/favourites/tests/component_favourite_service_test.php +++ b/favourites/tests/component_favourite_service_test.php @@ -29,6 +29,7 @@ use core_favourites\local\entity\favourite; class component_favourite_service_test extends \advanced_testcase { public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); } diff --git a/favourites/tests/privacy/provider_test.php b/favourites/tests/privacy/provider_test.php index 5be0f28793c..5d02ba15aa2 100644 --- a/favourites/tests/privacy/provider_test.php +++ b/favourites/tests/privacy/provider_test.php @@ -39,6 +39,7 @@ use core_privacy\local\request\transform; class provider_test extends provider_testcase { public function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); } diff --git a/favourites/tests/repository_test.php b/favourites/tests/repository_test.php index bf9e603e056..8798b509b0b 100644 --- a/favourites/tests/repository_test.php +++ b/favourites/tests/repository_test.php @@ -30,6 +30,7 @@ use core_favourites\local\entity\favourite; class repository_test extends \advanced_testcase { public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); } diff --git a/favourites/tests/user_favourite_service_test.php b/favourites/tests/user_favourite_service_test.php index 9c55d417933..3a5b27f64d7 100644 --- a/favourites/tests/user_favourite_service_test.php +++ b/favourites/tests/user_favourite_service_test.php @@ -29,6 +29,7 @@ use core_favourites\local\entity\favourite; class user_favourite_service_test extends \advanced_testcase { public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); } diff --git a/grade/export/ods/tests/event/events_test.php b/grade/export/ods/tests/event/events_test.php index 79bba738649..276d2cc13cf 100644 --- a/grade/export/ods/tests/event/events_test.php +++ b/grade/export/ods/tests/event/events_test.php @@ -29,6 +29,7 @@ class events_test extends \advanced_testcase { * Setup is called before calling test case. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); } diff --git a/grade/export/txt/tests/event/events_test.php b/grade/export/txt/tests/event/events_test.php index d01fb7a3299..1f7f2841f05 100644 --- a/grade/export/txt/tests/event/events_test.php +++ b/grade/export/txt/tests/event/events_test.php @@ -29,6 +29,7 @@ class events_test extends \advanced_testcase { * Setup is called before calling test case. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); } diff --git a/grade/export/xls/tests/event/events_test.php b/grade/export/xls/tests/event/events_test.php index f2f9a18b673..007925d39ab 100644 --- a/grade/export/xls/tests/event/events_test.php +++ b/grade/export/xls/tests/event/events_test.php @@ -29,6 +29,7 @@ class events_test extends \advanced_testcase { * Setup is called before calling test case. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); } diff --git a/grade/export/xml/tests/event/events_test.php b/grade/export/xml/tests/event/events_test.php index 9c8f909088d..bb59a00705f 100644 --- a/grade/export/xml/tests/event/events_test.php +++ b/grade/export/xml/tests/event/events_test.php @@ -29,6 +29,7 @@ class events_test extends \advanced_testcase { * Setup is called before calling test case. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); } diff --git a/grade/import/csv/tests/load_data_test.php b/grade/import/csv/tests/load_data_test.php index e7ffc403454..c09820c28d9 100644 --- a/grade/import/csv/tests/load_data_test.php +++ b/grade/import/csv/tests/load_data_test.php @@ -59,6 +59,7 @@ Bobby,Bunce,,"Moodle HQ","Rock on!",student5@example.com,75.00,,75.00,{exportdat public function tearDown(): void { $this->csvimport = null; + parent::tearDown(); } /** diff --git a/grade/report/grader/tests/privacy/provider_test.php b/grade/report/grader/tests/privacy/provider_test.php index d6351087a56..33b84b1b1e8 100644 --- a/grade/report/grader/tests/privacy/provider_test.php +++ b/grade/report/grader/tests/privacy/provider_test.php @@ -44,6 +44,7 @@ class provider_test extends \core_privacy\tests\provider_testcase { * Basic setup for these tests. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); } diff --git a/grade/report/overview/tests/externallib_test.php b/grade/report/overview/tests/externallib_test.php index 25329ad34f4..3538449a445 100644 --- a/grade/report/overview/tests/externallib_test.php +++ b/grade/report/overview/tests/externallib_test.php @@ -65,6 +65,7 @@ class externallib_test extends externallib_advanced_testcase { */ public function setUp(): void { global $DB; + parent::setUp(); $this->resetAfterTest(true); $s1grade1 = 80; diff --git a/grade/report/overview/tests/lib_test.php b/grade/report/overview/tests/lib_test.php index 0b1be6cea1e..56e2126ed16 100644 --- a/grade/report/overview/tests/lib_test.php +++ b/grade/report/overview/tests/lib_test.php @@ -33,6 +33,7 @@ class lib_test extends \advanced_testcase { global $CFG; require_once($CFG->dirroot . '/grade/report/overview/lib.php'); require_once($CFG->dirroot . '/grade/querylib.php'); + parent::setUp(); } /** diff --git a/grade/report/user/tests/lib_test.php b/grade/report/user/tests/lib_test.php index c24090a0ba0..7f86c82d3b4 100644 --- a/grade/report/user/tests/lib_test.php +++ b/grade/report/user/tests/lib_test.php @@ -53,6 +53,7 @@ class lib_test extends \advanced_testcase { private $tree; public function setUp(): void { + parent::setUp(); $this->user = $this->getDataGenerator()->create_user(); $this->course = $this->getDataGenerator()->create_course(); $this->tree = new \core_user\output\myprofile\tree(); diff --git a/grade/report/user/tests/privacy/provider_test.php b/grade/report/user/tests/privacy/provider_test.php index a159121a7a4..a462a34a32f 100644 --- a/grade/report/user/tests/privacy/provider_test.php +++ b/grade/report/user/tests/privacy/provider_test.php @@ -40,6 +40,7 @@ class provider_test extends \core_privacy\tests\provider_testcase { * Basic setup for these tests. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); } diff --git a/grade/tests/event/events_test.php b/grade/tests/event/events_test.php index 921c55ca569..a407c2dec1e 100644 --- a/grade/tests/event/events_test.php +++ b/grade/tests/event/events_test.php @@ -49,6 +49,7 @@ class events_test extends \advanced_testcase { * This is executed before running any test in this file. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); $this->setAdminUser(); diff --git a/grade/tests/importlib_test.php b/grade/tests/importlib_test.php index f79f19be35b..0dfc1aa9a75 100644 --- a/grade/tests/importlib_test.php +++ b/grade/tests/importlib_test.php @@ -34,6 +34,7 @@ class importlib_test extends \advanced_testcase { public static function setUpBeforeClass(): void { global $CFG; require_once("{$CFG->dirroot}/grade/import/lib.php"); + parent::setUpBeforeClass(); } /** diff --git a/grade/tests/output/general_action_bar_test.php b/grade/tests/output/general_action_bar_test.php index 49b09c061c8..d3439522c05 100644 --- a/grade/tests/output/general_action_bar_test.php +++ b/grade/tests/output/general_action_bar_test.php @@ -36,6 +36,7 @@ class general_action_bar_test extends advanced_testcase { public static function setUpBeforeClass(): void { global $CFG; require_once("{$CFG->dirroot}/grade/lib.php"); + parent::setUpBeforeClass(); } /** diff --git a/grade/tests/privacy/provider_test.php b/grade/tests/privacy/provider_test.php index 31ebd297dd0..aaea8975e10 100644 --- a/grade/tests/privacy/provider_test.php +++ b/grade/tests/privacy/provider_test.php @@ -50,6 +50,7 @@ class provider_test extends provider_testcase { public function setUp(): void { global $PAGE; + parent::setUp(); $this->resetAfterTest(); $PAGE->get_renderer('core'); } diff --git a/group/tests/customfield/group_handler_test.php b/group/tests/customfield/group_handler_test.php index a9073168ddc..405c7a54648 100644 --- a/group/tests/customfield/group_handler_test.php +++ b/group/tests/customfield/group_handler_test.php @@ -42,6 +42,7 @@ class group_handler_test extends advanced_testcase { * Setup. */ public function setUp(): void { + parent::setUp(); $this->handler = group_handler::create(); } diff --git a/group/tests/customfield/grouping_handler_test.php b/group/tests/customfield/grouping_handler_test.php index ca2b87a9bea..517ce05f27f 100644 --- a/group/tests/customfield/grouping_handler_test.php +++ b/group/tests/customfield/grouping_handler_test.php @@ -42,6 +42,7 @@ class grouping_handler_test extends advanced_testcase { * Setup. */ public function setUp(): void { + parent::setUp(); $this->handler = grouping_handler::create(); } diff --git a/h5p/tests/framework_test.php b/h5p/tests/framework_test.php index c7d2fc32df6..b0b7aaaebfc 100644 --- a/h5p/tests/framework_test.php +++ b/h5p/tests/framework_test.php @@ -42,6 +42,7 @@ class framework_test extends \advanced_testcase { * Set up function for tests. */ public function setUp(): void { + parent::setUp(); $factory = new \core_h5p\factory(); $this->framework = $factory->get_framework(); } diff --git a/h5p/tests/helper_test.php b/h5p/tests/helper_test.php index 66be51cd030..f2d82e5a95b 100644 --- a/h5p/tests/helper_test.php +++ b/h5p/tests/helper_test.php @@ -35,6 +35,7 @@ class helper_test extends \advanced_testcase { * Register the H5P autoloader */ protected function setUp(): void { + parent::setUp(); autoloader::register(); } diff --git a/iplookup/tests/geoip_test.php b/iplookup/tests/geoip_test.php index 1cc920402dd..d82882b18d6 100644 --- a/iplookup/tests/geoip_test.php +++ b/iplookup/tests/geoip_test.php @@ -34,6 +34,7 @@ require_once("{$CFG->dirroot}/iplookup/lib.php"); */ class geoip_test extends \advanced_testcase { public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); } diff --git a/iplookup/tests/geoplugin_test.php b/iplookup/tests/geoplugin_test.php index 08167e34497..ffb70961d01 100644 --- a/iplookup/tests/geoplugin_test.php +++ b/iplookup/tests/geoplugin_test.php @@ -32,12 +32,14 @@ class geoplugin_test extends \advanced_testcase { public static function setUpBeforeClass(): void { global $CFG; require_once("{$CFG->dirroot}/iplookup/lib.php"); + parent::setUpBeforeClass(); } /** * In order to execute this test PHPUNIT_LONGTEST should be defined as true in phpunit.xml or directly in config.php */ public function setUp(): void { + parent::setUp(); if (!PHPUNIT_LONGTEST) { $this->markTestSkipped('PHPUNIT_LONGTEST is not defined'); } diff --git a/lib/antivirus/clamav/tests/scanner_test.php b/lib/antivirus/clamav/tests/scanner_test.php index 696e15bfc48..1cf45b241eb 100644 --- a/lib/antivirus/clamav/tests/scanner_test.php +++ b/lib/antivirus/clamav/tests/scanner_test.php @@ -29,6 +29,7 @@ class scanner_test extends \advanced_testcase { protected $tempfile; protected function setUp(): void { + parent::setUp(); $this->resetAfterTest(); // Create tempfile. @@ -39,6 +40,7 @@ class scanner_test extends \advanced_testcase { protected function tearDown(): void { @unlink($this->tempfile); + parent::tearDown(); } public function test_scan_file_not_exists(): void { diff --git a/lib/dml/tests/pgsql_native_moodle_database_test.php b/lib/dml/tests/pgsql_native_moodle_database_test.php index 09e6030391d..476d9eae76a 100644 --- a/lib/dml/tests/pgsql_native_moodle_database_test.php +++ b/lib/dml/tests/pgsql_native_moodle_database_test.php @@ -47,6 +47,7 @@ class pgsql_native_moodle_database_test extends \advanced_testcase { public static function setUpBeforeClass(): void { global $CFG; require_once($CFG->libdir.'/dml/pgsql_native_moodle_database.php'); + parent::setUpBeforeClass(); } /** diff --git a/lib/external/tests/external_settings_test.php b/lib/external/tests/external_settings_test.php index da184f77c2b..fd3293a874e 100644 --- a/lib/external/tests/external_settings_test.php +++ b/lib/external/tests/external_settings_test.php @@ -31,6 +31,7 @@ class external_settings_test extends \advanced_testcase { */ public function tearDown(): void { external_settings::reset(); + parent::tearDown(); } /** diff --git a/lib/external/tests/privacy/provider_test.php b/lib/external/tests/privacy/provider_test.php index 009e16f8616..2f7c120acf1 100644 --- a/lib/external/tests/privacy/provider_test.php +++ b/lib/external/tests/privacy/provider_test.php @@ -43,6 +43,7 @@ use core_privacy\tests\provider_testcase; */ class provider_test extends provider_testcase { public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); } diff --git a/lib/external/tests/util_test.php b/lib/external/tests/util_test.php index 218a46b2912..f1283d5d127 100644 --- a/lib/external/tests/util_test.php +++ b/lib/external/tests/util_test.php @@ -34,6 +34,7 @@ class util_test extends \advanced_testcase { */ public function setUp(): void { global $DB; + parent::setUp(); $this->db = $DB; external_settings::reset(); @@ -63,6 +64,7 @@ class util_test extends \advanced_testcase { $DB = $this->db; } external_settings::reset(); + parent::tearDown(); } /** diff --git a/lib/filebrowser/tests/file_browser_test.php b/lib/filebrowser/tests/file_browser_test.php index 5044a810b46..d6e8a769961 100644 --- a/lib/filebrowser/tests/file_browser_test.php +++ b/lib/filebrowser/tests/file_browser_test.php @@ -59,6 +59,7 @@ class file_browser_test extends \advanced_testcase { */ public function setUp(): void { global $DB; + parent::setUp(); $this->resetAfterTest(); $this->setAdminUser(); diff --git a/lib/filestorage/tests/file_system_filedir_test.php b/lib/filestorage/tests/file_system_filedir_test.php index 7465cb91727..293e2ad16ec 100644 --- a/lib/filestorage/tests/file_system_filedir_test.php +++ b/lib/filestorage/tests/file_system_filedir_test.php @@ -39,6 +39,7 @@ class file_system_filedir_test extends \advanced_testcase { * Shared test setUp. */ public function setUp(): void { + parent::setUp(); // Reset the file storage so that subsequent fetches to get_file_storage are called after // configuration is prepared. get_file_storage(true); @@ -50,6 +51,7 @@ class file_system_filedir_test extends \advanced_testcase { public function tearDown(): void { // Reset the file storage so that subsequent tests will use the standard file storage. get_file_storage(true); + parent::tearDown(); } /** diff --git a/lib/filestorage/tests/file_system_test.php b/lib/filestorage/tests/file_system_test.php index cdc5e09dda0..a6db36d485d 100644 --- a/lib/filestorage/tests/file_system_test.php +++ b/lib/filestorage/tests/file_system_test.php @@ -38,11 +38,13 @@ require_once($CFG->libdir . '/filestorage/file_system.php'); class file_system_test extends \advanced_testcase { public function setUp(): void { + parent::setUp(); get_file_storage(true); } public function tearDown(): void { get_file_storage(true); + parent::tearDown(); } /** diff --git a/lib/phpunit/tests/advanced_test.php b/lib/phpunit/tests/advanced_test.php index 179864489a8..586771aefb0 100644 --- a/lib/phpunit/tests/advanced_test.php +++ b/lib/phpunit/tests/advanced_test.php @@ -29,6 +29,7 @@ class advanced_test extends \advanced_testcase { public static function setUpBeforeClass(): void { global $CFG; require_once(__DIR__ . '/fixtures/adhoc_test_task.php'); + parent::setUpBeforeClass(); } public function test_debugging(): void { diff --git a/lib/tests/antivirus_test.php b/lib/tests/antivirus_test.php index 401d9f61b4f..325e0e8d8e4 100644 --- a/lib/tests/antivirus_test.php +++ b/lib/tests/antivirus_test.php @@ -34,6 +34,7 @@ class antivirus_test extends advanced_testcase { protected function setUp(): void { global $CFG; + parent::setUp(); // Use our special testable fixture plugin. $CFG->antiviruses = 'testable'; @@ -69,6 +70,7 @@ class antivirus_test extends advanced_testcase { protected function tearDown(): void { @unlink($this->tempfile); + parent::tearDown(); } public function test_manager_get_antivirus(): void { diff --git a/lib/tests/attribute_helper_test.php b/lib/tests/attribute_helper_test.php index f8c4af8007d..4a7a919de3b 100644 --- a/lib/tests/attribute_helper_test.php +++ b/lib/tests/attribute_helper_test.php @@ -28,6 +28,7 @@ namespace core; final class attribute_helper_test extends \advanced_testcase { public static function setUpBeforeClass(): void { require_once(__DIR__ . '/fixtures/attribute_helper_example.php'); + parent::setUpBeforeClass(); } /** diff --git a/lib/tests/aws/admin_settings_aws_region_test.php b/lib/tests/aws/admin_settings_aws_region_test.php index 0b562943511..4fc203e2be8 100644 --- a/lib/tests/aws/admin_settings_aws_region_test.php +++ b/lib/tests/aws/admin_settings_aws_region_test.php @@ -44,6 +44,7 @@ class admin_settings_aws_region_test extends \advanced_testcase { public function tearDown(): void { $admin = admin_get_root(); $admin->purge_children(true); + parent::tearDown(); } /** * Test that output_html() method works and returns HTML string with expected content. diff --git a/lib/tests/behat_lib_test.php b/lib/tests/behat_lib_test.php index 303eb1f3504..8c5dd972c42 100644 --- a/lib/tests/behat_lib_test.php +++ b/lib/tests/behat_lib_test.php @@ -42,6 +42,7 @@ class behat_lib_test extends advanced_testcase { */ public function setUp(): void { global $CFG; + parent::setUp(); if (empty($CFG->behat_wwwroot) || empty($CFG->behat_dataroot) || empty($CFG->behat_prefix)) { $this->markTestSkipped('Behat not configured'); diff --git a/lib/tests/context_block_test.php b/lib/tests/context_block_test.php index 61c92718786..d3e8eadb4cb 100644 --- a/lib/tests/context_block_test.php +++ b/lib/tests/context_block_test.php @@ -34,6 +34,7 @@ class context_block_test extends \advanced_testcase { public function setUp(): void { global $CFG; require_once("{$CFG->libdir}/accesslib.php"); + parent::setUp(); } /** diff --git a/lib/tests/cron_test.php b/lib/tests/cron_test.php index cc2673da217..fb9fa284ce8 100644 --- a/lib/tests/cron_test.php +++ b/lib/tests/cron_test.php @@ -29,6 +29,7 @@ class cron_test extends \advanced_testcase { * Reset relevant caches between tests. */ public function setUp(): void { + parent::setUp(); cron::reset_user_cache(); } diff --git a/lib/tests/csvclass_test.php b/lib/tests/csvclass_test.php index fc218d1d6ab..aca71e3b243 100644 --- a/lib/tests/csvclass_test.php +++ b/lib/tests/csvclass_test.php @@ -41,6 +41,7 @@ class csvclass_test extends \advanced_testcase { protected $teststring4 = ''; protected function setUp(): void { + parent::setUp(); $this->resetAfterTest(); diff --git a/lib/tests/db/upgradelib_test.php b/lib/tests/db/upgradelib_test.php index f989d285ec8..429644e53c1 100644 --- a/lib/tests/db/upgradelib_test.php +++ b/lib/tests/db/upgradelib_test.php @@ -36,6 +36,7 @@ class upgradelib_test extends \advanced_testcase { require_once("{$CFG->libdir}/db/upgradelib.php"); require_once("{$CFG->dirroot}/my/lib.php"); + parent::setUp(); } /** diff --git a/lib/tests/encryption_test.php b/lib/tests/encryption_test.php index f106159bd30..54d2355d2c0 100644 --- a/lib/tests/encryption_test.php +++ b/lib/tests/encryption_test.php @@ -43,9 +43,11 @@ class encryption_test extends advanced_testcase { } remove_dir($CFG->dataroot . '/secret'); unset($CFG->nokeygeneration); + parent::tearDown(); } protected function setUp(): void { + parent::setUp(); $this->tearDown(); require_once(__DIR__ . '/fixtures/testable_encryption.php'); diff --git a/lib/tests/event/contentbank_content_created_test.php b/lib/tests/event/contentbank_content_created_test.php index 52e145f68ce..418fdb79bac 100644 --- a/lib/tests/event/contentbank_content_created_test.php +++ b/lib/tests/event/contentbank_content_created_test.php @@ -44,6 +44,7 @@ class contentbank_content_created_test extends \advanced_testcase { require_once($CFG->dirroot . '/contentbank/tests/fixtures/testable_contenttype.php'); require_once($CFG->dirroot . '/contentbank/tests/fixtures/testable_content.php'); + parent::setUpBeforeClass(); } /** diff --git a/lib/tests/event/contentbank_content_deleted_test.php b/lib/tests/event/contentbank_content_deleted_test.php index 81cc9f36020..740d8506e8a 100644 --- a/lib/tests/event/contentbank_content_deleted_test.php +++ b/lib/tests/event/contentbank_content_deleted_test.php @@ -44,6 +44,7 @@ class contentbank_content_deleted_test extends \advanced_testcase { require_once($CFG->dirroot . '/contentbank/tests/fixtures/testable_contenttype.php'); require_once($CFG->dirroot . '/contentbank/tests/fixtures/testable_content.php'); + parent::setUpBeforeClass(); } /** diff --git a/lib/tests/event/contentbank_content_updated_test.php b/lib/tests/event/contentbank_content_updated_test.php index 2379a8b81d6..e14d806ab79 100644 --- a/lib/tests/event/contentbank_content_updated_test.php +++ b/lib/tests/event/contentbank_content_updated_test.php @@ -44,6 +44,7 @@ class contentbank_content_updated_test extends \advanced_testcase { require_once($CFG->dirroot . '/contentbank/tests/fixtures/testable_contenttype.php'); require_once($CFG->dirroot . '/contentbank/tests/fixtures/testable_content.php'); + parent::setUpBeforeClass(); } /** diff --git a/lib/tests/event/contentbank_content_uploaded_test.php b/lib/tests/event/contentbank_content_uploaded_test.php index 131fc4f735e..a17028f1d23 100644 --- a/lib/tests/event/contentbank_content_uploaded_test.php +++ b/lib/tests/event/contentbank_content_uploaded_test.php @@ -46,6 +46,7 @@ class contentbank_content_uploaded_test extends \advanced_testcase { require_once($CFG->dirroot . '/contentbank/tests/fixtures/testable_contenttype.php'); require_once($CFG->dirroot . '/contentbank/tests/fixtures/testable_content.php'); + parent::setUpBeforeClass(); } /** diff --git a/lib/tests/event/contentbank_content_viewed_test.php b/lib/tests/event/contentbank_content_viewed_test.php index 8cdf1dff3f1..e170d55c0b5 100644 --- a/lib/tests/event/contentbank_content_viewed_test.php +++ b/lib/tests/event/contentbank_content_viewed_test.php @@ -44,6 +44,7 @@ class contentbank_content_viewed_test extends \advanced_testcase { require_once($CFG->dirroot . '/contentbank/tests/fixtures/testable_contenttype.php'); require_once($CFG->dirroot . '/contentbank/tests/fixtures/testable_content.php'); + parent::setUpBeforeClass(); } /** diff --git a/lib/tests/event/events_test.php b/lib/tests/event/events_test.php index 089a4154217..9367912b79c 100644 --- a/lib/tests/event/events_test.php +++ b/lib/tests/event/events_test.php @@ -37,6 +37,7 @@ class events_test extends \advanced_testcase { * This is executed before running any test in this file. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); } diff --git a/lib/tests/event/profile_field_test.php b/lib/tests/event/profile_field_test.php index ac066d445b2..b87565a193a 100644 --- a/lib/tests/event/profile_field_test.php +++ b/lib/tests/event/profile_field_test.php @@ -38,6 +38,7 @@ class profile_field_test extends \advanced_testcase { * Test set up. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); } diff --git a/lib/tests/event/user_graded_test.php b/lib/tests/event/user_graded_test.php index ab0dbcb608c..a627c8a7d30 100644 --- a/lib/tests/event/user_graded_test.php +++ b/lib/tests/event/user_graded_test.php @@ -36,6 +36,7 @@ class user_graded_test extends \advanced_testcase { * Tests set up. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); } diff --git a/lib/tests/exporter_test.php b/lib/tests/exporter_test.php index e835ad8a10c..2a80710c3f2 100644 --- a/lib/tests/exporter_test.php +++ b/lib/tests/exporter_test.php @@ -46,6 +46,7 @@ class exporter_test extends \advanced_testcase { protected $invaliddata = null; public function setUp(): void { + parent::setUp(); $s = new \stdClass(); $this->validrelated = array( 'simplestdClass' => $s, diff --git a/lib/tests/gdlib_test.php b/lib/tests/gdlib_test.php index da7d57bfedb..1830b5636c9 100644 --- a/lib/tests/gdlib_test.php +++ b/lib/tests/gdlib_test.php @@ -29,6 +29,7 @@ class gdlib_test extends \basic_testcase { private $fixturepath = null; public function setUp(): void { + parent::setUp(); $this->fixturepath = __DIR__ . DIRECTORY_SEPARATOR . 'fixtures' . DIRECTORY_SEPARATOR; } diff --git a/lib/tests/lock_test.php b/lib/tests/lock_test.php index 835734aa429..c36fdaf3dd1 100644 --- a/lib/tests/lock_test.php +++ b/lib/tests/lock_test.php @@ -30,6 +30,7 @@ class lock_test extends \advanced_testcase { * Some lock types will store data in the database. */ protected function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); } diff --git a/lib/tests/modinfolib_test.php b/lib/tests/modinfolib_test.php index 852002f295b..c522527af6b 100644 --- a/lib/tests/modinfolib_test.php +++ b/lib/tests/modinfolib_test.php @@ -44,6 +44,7 @@ class modinfolib_test extends advanced_testcase { global $CFG; require_once($CFG->dirroot . '/course/lib.php'); require_once($CFG->libdir . '/tests/fixtures/sectiondelegatetest.php'); + parent::setUpBeforeClass(); } public function test_section_info_properties(): void { diff --git a/lib/tests/myprofilelib_test.php b/lib/tests/myprofilelib_test.php index 1b0e571f583..95f58c43aa0 100644 --- a/lib/tests/myprofilelib_test.php +++ b/lib/tests/myprofilelib_test.php @@ -47,11 +47,13 @@ class myprofilelib_test extends \advanced_testcase { global $CFG; require_once($CFG->dirroot . '/lib/myprofilelib.php'); require_once($CFG->dirroot . '/user/profile/lib.php'); + parent::setUpBeforeClass(); } public function setUp(): void { // Set the $PAGE->url value so core_myprofile_navigation() doesn't complain. global $PAGE; + parent::setUp(); $PAGE->set_url('/test'); $this->user = $this->getDataGenerator()->create_user(); diff --git a/lib/tests/navigation/output/primary_test.php b/lib/tests/navigation/output/primary_test.php index 25507be0066..bf87e0e0269 100644 --- a/lib/tests/navigation/output/primary_test.php +++ b/lib/tests/navigation/output/primary_test.php @@ -32,6 +32,7 @@ class primary_test extends \advanced_testcase { */ public function setUp(): void { global $PAGE; + parent::setUp(); $this->resetAfterTest(); $pagecourse = $this->getDataGenerator()->create_course(); $assign = $this->getDataGenerator()->create_module('assign', ['course' => $pagecourse->id]); diff --git a/lib/tests/output/language_menu_test.php b/lib/tests/output/language_menu_test.php index 9e75675fadb..64bb0e1f172 100644 --- a/lib/tests/output/language_menu_test.php +++ b/lib/tests/output/language_menu_test.php @@ -32,6 +32,7 @@ class language_menu_test extends \advanced_testcase { */ public function setUp(): void { global $PAGE; + parent::setUp(); $this->resetAfterTest(); $PAGE->set_url('/'); } diff --git a/lib/tests/persistent_test.php b/lib/tests/persistent_test.php index b69e3d068fa..3b15d05ca17 100644 --- a/lib/tests/persistent_test.php +++ b/lib/tests/persistent_test.php @@ -33,6 +33,7 @@ use xmldb_table; class persistent_test extends advanced_testcase { public function setUp(): void { + parent::setUp(); $this->make_persistent_table(); $this->make_second_persistent_table(); $this->resetAfterTest(); diff --git a/lib/tests/plugin_manager_test.php b/lib/tests/plugin_manager_test.php index ac74346fc2c..7c9a8d11fe4 100644 --- a/lib/tests/plugin_manager_test.php +++ b/lib/tests/plugin_manager_test.php @@ -34,12 +34,14 @@ final class plugin_manager_test extends \advanced_testcase { global $CFG; require_once($CFG->dirroot . '/lib/tests/fixtures/testable_plugin_manager.php'); require_once($CFG->dirroot . '/lib/tests/fixtures/testable_plugininfo_base.php'); + parent::setUpBeforeClass(); } public function tearDown(): void { // The caches of the testable singleton must be reset explicitly. It is // safer to kill the whole testable singleton at the end of every test. testable_core_plugin_manager::reset_caches(); + parent::tearDown(); } public function test_instance(): void { diff --git a/lib/tests/plugininfo/base_test.php b/lib/tests/plugininfo/base_test.php index 6a04b96aec6..9b774ce1e0d 100644 --- a/lib/tests/plugininfo/base_test.php +++ b/lib/tests/plugininfo/base_test.php @@ -38,6 +38,7 @@ class base_test extends \advanced_testcase { require_once($CFG->dirroot.'/lib/tests/fixtures/testable_plugin_manager.php'); require_once($CFG->dirroot.'/lib/tests/fixtures/testable_plugininfo_base.php'); + parent::setUpBeforeClass(); } /** @@ -47,6 +48,7 @@ class base_test extends \advanced_testcase { // The caches of the testable singleton must be reset explicitly. It is // safer to kill the whole testable singleton at the end of every test. testable_core_plugin_manager::reset_caches(); + parent::tearDown(); } /** diff --git a/lib/tests/questionlib_test.php b/lib/tests/questionlib_test.php index fa362c26221..2c8183455dc 100644 --- a/lib/tests/questionlib_test.php +++ b/lib/tests/questionlib_test.php @@ -45,6 +45,7 @@ class questionlib_test extends \advanced_testcase { * This is executed before running any test in this file. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); } diff --git a/lib/tests/rsslib_test.php b/lib/tests/rsslib_test.php index 77fd86a7589..28943639c86 100644 --- a/lib/tests/rsslib_test.php +++ b/lib/tests/rsslib_test.php @@ -42,6 +42,7 @@ class rsslib_test extends \advanced_testcase { const TIMEOUT = 10; protected function setUp(): void { + parent::setUp(); \moodle_simplepie::reset_cache(); } diff --git a/lib/tests/session_redis_cluster_test.php b/lib/tests/session_redis_cluster_test.php index 826160d0cfe..4d71e9fd3b5 100644 --- a/lib/tests/session_redis_cluster_test.php +++ b/lib/tests/session_redis_cluster_test.php @@ -45,6 +45,7 @@ class session_redis_cluster_test extends \advanced_testcase { */ public function setUp(): void { global $CFG; + parent::setUp(); if (!\cache_helper::is_cluster_available()) { $this->markTestSkipped('Could not test core_session with cluster, class RedisCluster is not available.'); diff --git a/lib/tests/session_redis_test.php b/lib/tests/session_redis_test.php index 00b1828ccf3..acba4eeeb98 100644 --- a/lib/tests/session_redis_test.php +++ b/lib/tests/session_redis_test.php @@ -51,6 +51,7 @@ class session_redis_test extends \advanced_testcase { public function setUp(): void { global $CFG; + parent::setUp(); if (!extension_loaded('redis')) { $this->markTestSkipped('Redis extension not loaded.'); @@ -108,6 +109,7 @@ class session_redis_test extends \advanced_testcase { $this->redis->del($keyname); } $this->redis->close(); + parent::tearDown(); } public function test_normal_session_read_only(): void { diff --git a/lib/tests/task/calendar_cron_task_test.php b/lib/tests/task/calendar_cron_task_test.php index 115a341bc38..4f011c84fcb 100644 --- a/lib/tests/task/calendar_cron_task_test.php +++ b/lib/tests/task/calendar_cron_task_test.php @@ -34,6 +34,7 @@ class calendar_cron_task_test extends \advanced_testcase { * Tests set up */ protected function setUp(): void { + parent::setUp(); $this->resetAfterTest(); } diff --git a/lib/tests/task/database_logger_test.php b/lib/tests/task/database_logger_test.php index 80588bf2fd2..f71e27ea3f2 100644 --- a/lib/tests/task/database_logger_test.php +++ b/lib/tests/task/database_logger_test.php @@ -36,6 +36,7 @@ class database_logger_test extends \advanced_testcase { */ public function setUp(): void { global $DB; + parent::setUp(); $this->DB = $DB; } @@ -48,6 +49,7 @@ class database_logger_test extends \advanced_testcase { $DB = $this->DB; $this->DB = null; + parent::tearDown(); } /** diff --git a/lib/tests/task/logging_test.php b/lib/tests/task/logging_test.php index 4116c8ce9ef..ed96b728b8a 100644 --- a/lib/tests/task/logging_test.php +++ b/lib/tests/task/logging_test.php @@ -56,6 +56,7 @@ class logging_test extends \advanced_testcase { $DB = $this->DB; $this->DB = null; } + parent::tearDown(); } /** diff --git a/lib/tests/task/running_test.php b/lib/tests/task/running_test.php index 701f43d5d32..d10a5ca1184 100644 --- a/lib/tests/task/running_test.php +++ b/lib/tests/task/running_test.php @@ -27,6 +27,7 @@ namespace core\task; final class running_test extends \advanced_testcase { public static function setUpBeforeClass(): void { require_once(__DIR__ . '/../fixtures/task_fixtures.php'); + parent::setUpBeforeClass(); } /** diff --git a/lib/tests/user_test.php b/lib/tests/user_test.php index 182f49cd6d6..47ba26ec769 100644 --- a/lib/tests/user_test.php +++ b/lib/tests/user_test.php @@ -30,6 +30,7 @@ class user_test extends \advanced_testcase { * Setup test data. */ protected function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); } diff --git a/lib/tests/useragent_test.php b/lib/tests/useragent_test.php index b184cce37d8..2aed0021115 100644 --- a/lib/tests/useragent_test.php +++ b/lib/tests/useragent_test.php @@ -29,6 +29,7 @@ class useragent_test extends advanced_testcase { */ public function tearDown(): void { core_useragent::instance(true); + parent::tearDown(); } /** diff --git a/lib/tests/xhprof_test.php b/lib/tests/xhprof_test.php index 527b1c4a354..d8f90ca3a1b 100644 --- a/lib/tests/xhprof_test.php +++ b/lib/tests/xhprof_test.php @@ -29,6 +29,7 @@ class xhprof_test extends \advanced_testcase { public static function setUpBeforeClass(): void { global $CFG; require_once($CFG->libdir . '/xhprof/xhprof_moodle.php'); + parent::setUpBeforeClass(); } /** diff --git a/lib/tests/xsendfilelib_test.php b/lib/tests/xsendfilelib_test.php index 4b98d8c3317..ce214111158 100644 --- a/lib/tests/xsendfilelib_test.php +++ b/lib/tests/xsendfilelib_test.php @@ -31,6 +31,7 @@ final class xsendfilelib_test extends \advanced_testcase { public static function setUpBeforeClass(): void { global $CFG; require_once($CFG->libdir . '/xsendfilelib.php'); + parent::setUpBeforeClass(); } public function test_not_enabled(): void { diff --git a/lib/xapi/tests/api_test.php b/lib/xapi/tests/api_test.php index dd6848f55a0..ccecc7b703b 100644 --- a/lib/xapi/tests/api_test.php +++ b/lib/xapi/tests/api_test.php @@ -36,6 +36,7 @@ class api_test extends advanced_testcase { public static function setUpBeforeClass(): void { global $CFG; require_once($CFG->dirroot.'/lib/xapi/tests/helper.php'); + parent::setUpBeforeClass(); } /** diff --git a/lib/xapi/tests/external/delete_state_test.php b/lib/xapi/tests/external/delete_state_test.php index a99cfcd317f..9d5c97d0a55 100644 --- a/lib/xapi/tests/external/delete_state_test.php +++ b/lib/xapi/tests/external/delete_state_test.php @@ -47,6 +47,7 @@ class delete_state_test extends externallib_advanced_testcase { public static function setUpBeforeClass(): void { global $CFG; require_once($CFG->dirroot . '/lib/xapi/tests/helper.php'); + parent::setUpBeforeClass(); } /** diff --git a/lib/xapi/tests/external/delete_states_test.php b/lib/xapi/tests/external/delete_states_test.php index 3dad00aa3be..95e5c890a16 100644 --- a/lib/xapi/tests/external/delete_states_test.php +++ b/lib/xapi/tests/external/delete_states_test.php @@ -47,6 +47,7 @@ class delete_states_test extends externallib_advanced_testcase { public static function setUpBeforeClass(): void { global $CFG; require_once($CFG->dirroot . '/lib/xapi/tests/helper.php'); + parent::setUpBeforeClass(); } /** diff --git a/lib/xapi/tests/external/get_state_test.php b/lib/xapi/tests/external/get_state_test.php index f29e15dbbbe..40677b52208 100644 --- a/lib/xapi/tests/external/get_state_test.php +++ b/lib/xapi/tests/external/get_state_test.php @@ -47,6 +47,7 @@ class get_state_test extends externallib_advanced_testcase { public static function setUpBeforeClass(): void { global $CFG; require_once($CFG->dirroot . '/lib/xapi/tests/helper.php'); + parent::setUpBeforeClass(); } /** diff --git a/lib/xapi/tests/external/get_states_test.php b/lib/xapi/tests/external/get_states_test.php index a98bfeb0ab9..f7a38316e85 100644 --- a/lib/xapi/tests/external/get_states_test.php +++ b/lib/xapi/tests/external/get_states_test.php @@ -47,6 +47,7 @@ class get_states_test extends externallib_advanced_testcase { public static function setUpBeforeClass(): void { global $CFG; require_once($CFG->dirroot . '/lib/xapi/tests/helper.php'); + parent::setUpBeforeClass(); } /** diff --git a/lib/xapi/tests/external/post_state_test.php b/lib/xapi/tests/external/post_state_test.php index 208a7ccc0b3..72ad9345893 100644 --- a/lib/xapi/tests/external/post_state_test.php +++ b/lib/xapi/tests/external/post_state_test.php @@ -46,6 +46,7 @@ class post_state_test extends externallib_advanced_testcase { public static function setUpBeforeClass(): void { global $CFG; require_once($CFG->dirroot . '/lib/xapi/tests/helper.php'); + parent::setUpBeforeClass(); } /** diff --git a/lib/xapi/tests/external/post_statement_test.php b/lib/xapi/tests/external/post_statement_test.php index 9262c45d586..f1fca734181 100644 --- a/lib/xapi/tests/external/post_statement_test.php +++ b/lib/xapi/tests/external/post_statement_test.php @@ -66,6 +66,7 @@ class post_statement_test extends externallib_advanced_testcase { */ public function setUp(): void { global $CFG; + parent::setUp(); // We disable group actors on the test xapi_handler. $CFG->xapitestforcegroupactors = false; } diff --git a/lib/xapi/tests/handler_test.php b/lib/xapi/tests/handler_test.php index 5a68016f554..45e428d7250 100644 --- a/lib/xapi/tests/handler_test.php +++ b/lib/xapi/tests/handler_test.php @@ -42,6 +42,7 @@ class handler_test extends advanced_testcase { public static function setUpBeforeClass(): void { global $CFG; require_once($CFG->dirroot.'/lib/xapi/tests/helper.php'); + parent::setUpBeforeClass(); } /** diff --git a/lib/xapi/tests/privacy/provider_test.php b/lib/xapi/tests/privacy/provider_test.php index ab6b48c1488..94e6535da7b 100644 --- a/lib/xapi/tests/privacy/provider_test.php +++ b/lib/xapi/tests/privacy/provider_test.php @@ -39,6 +39,7 @@ class provider_test extends provider_testcase { public static function setUpBeforeClass(): void { global $CFG; require_once($CFG->dirroot.'/lib/xapi/tests/helper.php'); + parent::setUpBeforeClass(); } /** diff --git a/lib/xapi/tests/state_store_test.php b/lib/xapi/tests/state_store_test.php index fd50f29077f..eddaa3918fa 100644 --- a/lib/xapi/tests/state_store_test.php +++ b/lib/xapi/tests/state_store_test.php @@ -37,6 +37,7 @@ class state_store_test extends advanced_testcase { public static function setUpBeforeClass(): void { global $CFG; require_once($CFG->dirroot.'/lib/xapi/tests/helper.php'); + parent::setUpBeforeClass(); } /** diff --git a/lib/xapi/tests/task/state_cleanup_task_test.php b/lib/xapi/tests/task/state_cleanup_task_test.php index 40f9653146e..9f62a562d39 100644 --- a/lib/xapi/tests/task/state_cleanup_task_test.php +++ b/lib/xapi/tests/task/state_cleanup_task_test.php @@ -37,6 +37,7 @@ class state_cleanup_task_test extends advanced_testcase { public static function setUpBeforeClass(): void { global $CFG; require_once($CFG->dirroot.'/lib/xapi/tests/helper.php'); + parent::setUpBeforeClass(); } /** diff --git a/message/output/airnotifier/tests/externallib_test.php b/message/output/airnotifier/tests/externallib_test.php index 17d59baa39e..d73c2c6e07f 100644 --- a/message/output/airnotifier/tests/externallib_test.php +++ b/message/output/airnotifier/tests/externallib_test.php @@ -42,6 +42,7 @@ class externallib_test extends externallib_advanced_testcase { protected function setUp(): void { global $CFG; require_once($CFG->dirroot . '/message/output/airnotifier/externallib.php'); + parent::setUp(); } /** diff --git a/message/output/airnotifier/tests/privacy/provider_test.php b/message/output/airnotifier/tests/privacy/provider_test.php index 84f8dc5476e..53552c2276c 100644 --- a/message/output/airnotifier/tests/privacy/provider_test.php +++ b/message/output/airnotifier/tests/privacy/provider_test.php @@ -40,6 +40,7 @@ class provider_test extends provider_testcase { * Basic setup for these tests. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); } diff --git a/message/output/email/tests/privacy/provider_test.php b/message/output/email/tests/privacy/provider_test.php index 3665e61ab50..e6e724880dd 100644 --- a/message/output/email/tests/privacy/provider_test.php +++ b/message/output/email/tests/privacy/provider_test.php @@ -34,6 +34,7 @@ class provider_test extends provider_testcase { * Basic setup for these tests. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); } diff --git a/message/output/popup/tests/api_test.php b/message/output/popup/tests/api_test.php index 4cdf66523aa..ce36f7a826d 100644 --- a/message/output/popup/tests/api_test.php +++ b/message/output/popup/tests/api_test.php @@ -43,6 +43,7 @@ class api_test extends \advanced_testcase { * This is executed before running any test in this file. */ public function setUp(): void { + parent::setUp(); $this->preventResetByRollback(); // Messaging is not compatible with transactions. $this->messagesink = $this->redirectMessages(); $this->resetAfterTest(); diff --git a/message/output/popup/tests/externallib_test.php b/message/output/popup/tests/externallib_test.php index e92a9274924..19d6baff17b 100644 --- a/message/output/popup/tests/externallib_test.php +++ b/message/output/popup/tests/externallib_test.php @@ -46,6 +46,7 @@ class externallib_test extends \advanced_testcase { * This is executed before running any test in this file. */ public function setUp(): void { + parent::setUp(); $this->preventResetByRollback(); // Messaging is not compatible with transactions. $this->messagesink = $this->redirectMessages(); $this->resetAfterTest(); diff --git a/message/tests/event/events_test.php b/message/tests/event/events_test.php index 1dc0072b683..660245406d8 100644 --- a/message/tests/event/events_test.php +++ b/message/tests/event/events_test.php @@ -47,6 +47,7 @@ class events_test extends \core_message\messagelib_test { * This is executed before running any test in this file. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); } diff --git a/message/tests/externallib_test.php b/message/tests/externallib_test.php index 6769c630c8a..867ff6d46be 100644 --- a/message/tests/externallib_test.php +++ b/message/tests/externallib_test.php @@ -45,6 +45,7 @@ class externallib_test extends externallib_advanced_testcase { global $CFG; require_once($CFG->dirroot . '/message/lib.php'); + parent::setUp(); } /** diff --git a/message/tests/helper_test.php b/message/tests/helper_test.php index e00f729b486..06c25d40eb4 100644 --- a/message/tests/helper_test.php +++ b/message/tests/helper_test.php @@ -34,6 +34,7 @@ require_once($CFG->dirroot . '/message/tests/messagelib_test.php'); class helper_test extends \advanced_testcase { public function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); } diff --git a/message/tests/inbound_test.php b/message/tests/inbound_test.php index 1ad996f7619..c4a74740f39 100644 --- a/message/tests/inbound_test.php +++ b/message/tests/inbound_test.php @@ -43,6 +43,7 @@ class inbound_test extends \advanced_testcase { */ public function setUp(): void { global $CFG; + parent::setUp(); $this->resetAfterTest(true); diff --git a/message/tests/messagelib_test.php b/message/tests/messagelib_test.php index 6e78954ccd9..15103d9087a 100644 --- a/message/tests/messagelib_test.php +++ b/message/tests/messagelib_test.php @@ -42,6 +42,7 @@ class messagelib_test extends \advanced_testcase { * This is executed before running any test in this file. */ public function setUp(): void { + parent::setUp(); $this->preventResetByRollback(); // Messaging is not compatible with transactions. $this->messagesink = $this->redirectMessages(); $this->resetAfterTest(); diff --git a/message/tests/search_received_test.php b/message/tests/search_received_test.php index eb62556a220..0f1fa3b5117 100644 --- a/message/tests/search_received_test.php +++ b/message/tests/search_received_test.php @@ -40,6 +40,7 @@ class search_received_test extends \advanced_testcase { * @return void */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); set_config('enableglobalsearch', true); diff --git a/message/tests/search_sent_test.php b/message/tests/search_sent_test.php index c827254e2f5..296477e116c 100644 --- a/message/tests/search_sent_test.php +++ b/message/tests/search_sent_test.php @@ -40,6 +40,7 @@ class search_sent_test extends \advanced_testcase { * @return void */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); set_config('enableglobalsearch', true); diff --git a/message/tests/task/migrate_message_data_test.php b/message/tests/task/migrate_message_data_test.php index 15c97791b4c..44b1e333db4 100644 --- a/message/tests/task/migrate_message_data_test.php +++ b/message/tests/task/migrate_message_data_test.php @@ -38,6 +38,7 @@ class migrate_message_data_test extends \advanced_testcase { * This is executed before running any test in this file. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); } diff --git a/mnet/service/enrol/tests/privacy/provider_test.php b/mnet/service/enrol/tests/privacy/provider_test.php index dc0055bd075..171dc881fcf 100644 --- a/mnet/service/enrol/tests/privacy/provider_test.php +++ b/mnet/service/enrol/tests/privacy/provider_test.php @@ -54,6 +54,7 @@ class provider_test extends provider_testcase { */ public function setUp(): void { global $DB; + parent::setUp(); // Add a mnet host. $this->mnethost = new \stdClass(); diff --git a/mnet/tests/event/events_test.php b/mnet/tests/event/events_test.php index 4cae715ee3a..399cc1cdfd7 100644 --- a/mnet/tests/event/events_test.php +++ b/mnet/tests/event/events_test.php @@ -43,6 +43,7 @@ class events_test extends \advanced_testcase { */ public function setUp(): void { global $DB; + parent::setUp(); $this->resetAfterTest(); diff --git a/mod/assign/tests/base_test.php b/mod/assign/tests/base_test.php index e86739351b2..69347148ec1 100644 --- a/mod/assign/tests/base_test.php +++ b/mod/assign/tests/base_test.php @@ -83,6 +83,7 @@ class base_test extends \advanced_testcase { */ protected function setUp(): void { global $DB; + parent::setUp(); $this->resetAfterTest(true); diff --git a/mod/bigbluebuttonbn/tests/local/extension_test.php b/mod/bigbluebuttonbn/tests/local/extension_test.php index ecd110763ef..be5a973e1d3 100644 --- a/mod/bigbluebuttonbn/tests/local/extension_test.php +++ b/mod/bigbluebuttonbn/tests/local/extension_test.php @@ -46,6 +46,7 @@ class extension_test extends \advanced_testcase { * @return void */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); $this->setup_fake_plugin('simple'); $this->resetDebugging(); // We might have debugging messages issued from setup_fake_plugin here that we need to get rid of. @@ -59,6 +60,7 @@ class extension_test extends \advanced_testcase { */ public function tearDown(): void { $this->uninstall_fake_plugin('simple'); + parent::tearDown(); } /** diff --git a/mod/bigbluebuttonbn/tests/search_test.php b/mod/bigbluebuttonbn/tests/search_test.php index b1b3e454612..ddebc9344b8 100644 --- a/mod/bigbluebuttonbn/tests/search_test.php +++ b/mod/bigbluebuttonbn/tests/search_test.php @@ -44,6 +44,7 @@ class search_test extends advanced_testcase { protected $bbbactivtyarea = null; public function setUp(): void { + parent::setUp(); set_config('enableglobalsearch', true); $this->bbbactivtyarea = \core_search\manager::get_search_area('mod_bigbluebuttonbn-activity'); } diff --git a/mod/book/tests/event/events_test.php b/mod/book/tests/event/events_test.php index dfff2b98b5d..ecf83b2db0e 100644 --- a/mod/book/tests/event/events_test.php +++ b/mod/book/tests/event/events_test.php @@ -36,6 +36,7 @@ namespace mod_book\event; class events_test extends \advanced_testcase { public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); } diff --git a/mod/book/tests/lib_test.php b/mod/book/tests/lib_test.php index 6c6558447c7..f7c0222dd8f 100644 --- a/mod/book/tests/lib_test.php +++ b/mod/book/tests/lib_test.php @@ -42,6 +42,7 @@ require_once($CFG->dirroot . '/mod/book/lib.php'); class lib_test extends \advanced_testcase { public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); $this->setAdminUser(); } diff --git a/mod/book/tests/search/search_test.php b/mod/book/tests/search/search_test.php index ebec89b43d3..d83a0a0ad51 100644 --- a/mod/book/tests/search/search_test.php +++ b/mod/book/tests/search/search_test.php @@ -46,6 +46,7 @@ class search_test extends \advanced_testcase { protected $bookchapterareaid = null; public function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); set_config('enableglobalsearch', true); diff --git a/mod/book/tool/exportimscp/tests/event/events_test.php b/mod/book/tool/exportimscp/tests/event/events_test.php index b164ee3df10..c121be17e17 100644 --- a/mod/book/tool/exportimscp/tests/event/events_test.php +++ b/mod/book/tool/exportimscp/tests/event/events_test.php @@ -36,6 +36,7 @@ namespace booktool_exportimscp\event; class events_test extends \advanced_testcase { public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); } diff --git a/mod/book/tool/importhtml/tests/locallib_test.php b/mod/book/tool/importhtml/tests/locallib_test.php index 56c1166f1e1..6fd2a7ade5b 100644 --- a/mod/book/tool/importhtml/tests/locallib_test.php +++ b/mod/book/tool/importhtml/tests/locallib_test.php @@ -40,6 +40,7 @@ require_once($CFG->dirroot.'/mod/book/tool/importhtml/locallib.php'); class locallib_test extends \advanced_testcase { public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); } diff --git a/mod/book/tool/print/tests/event/events_test.php b/mod/book/tool/print/tests/event/events_test.php index 773b9f6adee..11af2194b85 100644 --- a/mod/book/tool/print/tests/event/events_test.php +++ b/mod/book/tool/print/tests/event/events_test.php @@ -36,6 +36,7 @@ namespace booktool_print\event; class events_test extends \advanced_testcase { public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); } diff --git a/mod/chat/tests/dates_test.php b/mod/chat/tests/dates_test.php index fef016a873c..8bfacdbec3d 100644 --- a/mod/chat/tests/dates_test.php +++ b/mod/chat/tests/dates_test.php @@ -40,6 +40,7 @@ class dates_test extends advanced_testcase { * Setup testcase. */ public function setUp(): void { + parent::setUp(); // Chat module is disabled by default, enable it for testing. $manager = \core_plugin_manager::resolve_plugininfo_class('mod'); $manager::enable_plugin('chat', 1); diff --git a/mod/chat/tests/event/events_test.php b/mod/chat/tests/event/events_test.php index f2cfa206b22..1977d0bd253 100644 --- a/mod/chat/tests/event/events_test.php +++ b/mod/chat/tests/event/events_test.php @@ -42,6 +42,7 @@ class events_test extends \advanced_testcase { * Setup testcase. */ public function setUp(): void { + parent::setUp(); // Chat module is disabled by default, enable it for testing. $manager = \core_plugin_manager::resolve_plugininfo_class('mod'); $manager::enable_plugin('chat', 1); diff --git a/mod/chat/tests/externallib_test.php b/mod/chat/tests/externallib_test.php index 628ba033c7d..bcbe298dd87 100644 --- a/mod/chat/tests/externallib_test.php +++ b/mod/chat/tests/externallib_test.php @@ -41,6 +41,7 @@ class externallib_test extends externallib_advanced_testcase { * Setup testcase. */ public function setUp(): void { + parent::setUp(); // Chat module is disabled by default, enable it for testing. $manager = \core_plugin_manager::resolve_plugininfo_class('mod'); $manager::enable_plugin('chat', 1); diff --git a/mod/chat/tests/generator_test.php b/mod/chat/tests/generator_test.php index ac98f8064d3..9f969db6946 100644 --- a/mod/chat/tests/generator_test.php +++ b/mod/chat/tests/generator_test.php @@ -29,6 +29,7 @@ class generator_test extends \advanced_testcase { * Setup testcase. */ public function setUp(): void { + parent::setUp(); // Chat module is disabled by default, enable it for testing. $manager = \core_plugin_manager::resolve_plugininfo_class('mod'); $manager::enable_plugin('chat', 1); diff --git a/mod/chat/tests/lib_test.php b/mod/chat/tests/lib_test.php index 2e35498f50b..38ad7b91bb8 100644 --- a/mod/chat/tests/lib_test.php +++ b/mod/chat/tests/lib_test.php @@ -37,6 +37,7 @@ defined('MOODLE_INTERNAL') || die(); class lib_test extends \advanced_testcase { public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); // Chat module is disabled by default, enable it for testing. diff --git a/mod/chat/tests/privacy/provider_test.php b/mod/chat/tests/privacy/provider_test.php index 89506607844..bc44b8f5afa 100644 --- a/mod/chat/tests/privacy/provider_test.php +++ b/mod/chat/tests/privacy/provider_test.php @@ -50,6 +50,7 @@ class provider_test extends provider_testcase { public function setUp(): void { global $PAGE; + parent::setUp(); $this->resetAfterTest(); $PAGE->get_renderer('core'); diff --git a/mod/choice/tests/event/events_test.php b/mod/choice/tests/event/events_test.php index dd3495ff18c..879111add2e 100644 --- a/mod/choice/tests/event/events_test.php +++ b/mod/choice/tests/event/events_test.php @@ -54,6 +54,7 @@ class events_test extends \advanced_testcase { */ protected function setUp(): void { global $DB; + parent::setUp(); $this->resetAfterTest(); diff --git a/mod/choice/tests/privacy/provider_test.php b/mod/choice/tests/privacy/provider_test.php index 79d8588a4b3..b3a59ec3846 100644 --- a/mod/choice/tests/privacy/provider_test.php +++ b/mod/choice/tests/privacy/provider_test.php @@ -50,6 +50,7 @@ class provider_test extends \core_privacy\tests\provider_testcase { * {@inheritdoc} */ protected function setUp(): void { + parent::setUp(); $this->resetAfterTest(); global $DB; diff --git a/mod/data/tests/event/events_test.php b/mod/data/tests/event/events_test.php index 76bb401bfbe..40fdee1408f 100644 --- a/mod/data/tests/event/events_test.php +++ b/mod/data/tests/event/events_test.php @@ -37,6 +37,7 @@ class events_test extends \advanced_testcase { * This is executed before running any test in this file. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); } diff --git a/mod/data/tests/externallib_test.php b/mod/data/tests/externallib_test.php index 5db85343821..ac0763a5c6c 100644 --- a/mod/data/tests/externallib_test.php +++ b/mod/data/tests/externallib_test.php @@ -83,6 +83,7 @@ class externallib_test extends externallib_advanced_testcase { */ public function setUp(): void { global $DB; + parent::setUp(); $this->resetAfterTest(); $this->setAdminUser(); diff --git a/mod/data/tests/lib_test.php b/mod/data/tests/lib_test.php index 15b19428997..8e7f9c71da6 100644 --- a/mod/data/tests/lib_test.php +++ b/mod/data/tests/lib_test.php @@ -55,6 +55,7 @@ class lib_test extends \advanced_testcase { $DB = $this->DB; $this->DB = null; } + parent::tearDown(); } /** diff --git a/mod/data/tests/privacy/provider_test.php b/mod/data/tests/privacy/provider_test.php index 623b667ba09..fb0559e8b5e 100644 --- a/mod/data/tests/privacy/provider_test.php +++ b/mod/data/tests/privacy/provider_test.php @@ -54,6 +54,7 @@ class provider_test extends \core_privacy\tests\provider_testcase { * {@inheritdoc} */ protected function setUp(): void { + parent::setUp(); $this->resetAfterTest(); global $DB; diff --git a/mod/feedback/tests/event/events_test.php b/mod/feedback/tests/event/events_test.php index d4b850020e9..4dfa76e82ac 100644 --- a/mod/feedback/tests/event/events_test.php +++ b/mod/feedback/tests/event/events_test.php @@ -58,6 +58,7 @@ class events_test extends \advanced_testcase { public function setUp(): void { global $DB; + parent::setUp(); $this->setAdminUser(); $gen = $this->getDataGenerator(); diff --git a/mod/feedback/tests/external/external_test.php b/mod/feedback/tests/external/external_test.php index 9b3291985f8..5c469424861 100644 --- a/mod/feedback/tests/external/external_test.php +++ b/mod/feedback/tests/external/external_test.php @@ -67,6 +67,7 @@ class external_test extends externallib_advanced_testcase { */ public function setUp(): void { global $DB; + parent::setUp(); $this->resetAfterTest(); $this->setAdminUser(); diff --git a/mod/feedback/tests/privacy/provider_test.php b/mod/feedback/tests/privacy/provider_test.php index 6406531320c..75ef5024c8e 100644 --- a/mod/feedback/tests/privacy/provider_test.php +++ b/mod/feedback/tests/privacy/provider_test.php @@ -49,6 +49,7 @@ require_once($CFG->dirroot . '/mod/feedback/lib.php'); class provider_test extends provider_testcase { public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); } diff --git a/mod/folder/tests/event/events_test.php b/mod/folder/tests/event/events_test.php index c3895ee478d..54fb00e851b 100644 --- a/mod/folder/tests/event/events_test.php +++ b/mod/folder/tests/event/events_test.php @@ -31,6 +31,7 @@ class events_test extends \advanced_testcase { * Tests set up. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); } diff --git a/mod/folder/tests/lib_test.php b/mod/folder/tests/lib_test.php index 986f52758be..d802496907a 100644 --- a/mod/folder/tests/lib_test.php +++ b/mod/folder/tests/lib_test.php @@ -46,6 +46,7 @@ class lib_test extends \advanced_testcase { * Setup. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); $this->setAdminUser(); } @@ -57,6 +58,7 @@ class lib_test extends \advanced_testcase { public static function setUpBeforeClass(): void { global $CFG; require_once($CFG->dirroot . '/mod/folder/lib.php'); + parent::setUpBeforeClass(); } /** diff --git a/mod/folder/tests/search/search_test.php b/mod/folder/tests/search/search_test.php index bb7bfd2c081..547c27caedd 100644 --- a/mod/folder/tests/search/search_test.php +++ b/mod/folder/tests/search/search_test.php @@ -46,6 +46,7 @@ class search_test extends \advanced_testcase { protected $folderareaid = null; public function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); set_config('enableglobalsearch', true); diff --git a/mod/forum/tests/builders_exported_posts_test.php b/mod/forum/tests/builders_exported_posts_test.php index fd88c64363a..1d7341794de 100644 --- a/mod/forum/tests/builders_exported_posts_test.php +++ b/mod/forum/tests/builders_exported_posts_test.php @@ -40,6 +40,7 @@ class builders_exported_posts_test extends \advanced_testcase { * Set up function for tests. */ public function setUp(): void { + parent::setUp(); // We must clear the subscription caches. This has to be done both before each test, and after in case of other // tests using these functions. \mod_forum\subscriptions::reset_forum_cache(); @@ -55,6 +56,7 @@ class builders_exported_posts_test extends \advanced_testcase { // We must clear the subscription caches. This has to be done both before each test, and after in case of other // tests using these functions. \mod_forum\subscriptions::reset_forum_cache(); + parent::tearDown(); } /** diff --git a/mod/forum/tests/event/events_test.php b/mod/forum/tests/event/events_test.php index 7deb73afbb6..63928d33b6b 100644 --- a/mod/forum/tests/event/events_test.php +++ b/mod/forum/tests/event/events_test.php @@ -39,6 +39,7 @@ class events_test extends \advanced_testcase { * Tests set up. */ public function setUp(): void { + parent::setUp(); // We must clear the subscription caches. This has to be done both before each test, and after in case of other // tests using these functions. \mod_forum\subscriptions::reset_forum_cache(); @@ -50,6 +51,7 @@ class events_test extends \advanced_testcase { // We must clear the subscription caches. This has to be done both before each test, and after in case of other // tests using these functions. \mod_forum\subscriptions::reset_forum_cache(); + parent::tearDown(); } /** diff --git a/mod/forum/tests/exporters_discussion_test.php b/mod/forum/tests/exporters_discussion_test.php index cc8354ce9b5..132b95dfe93 100644 --- a/mod/forum/tests/exporters_discussion_test.php +++ b/mod/forum/tests/exporters_discussion_test.php @@ -35,6 +35,7 @@ class exporters_discussion_test extends \advanced_testcase { * Test set up function. */ public function setUp(): void { + parent::setUp(); // We must clear the subscription caches. This has to be done both before each test, and after in case of other // tests using these functions. \mod_forum\subscriptions::reset_forum_cache(); @@ -50,6 +51,7 @@ class exporters_discussion_test extends \advanced_testcase { // We must clear the subscription caches. This has to be done both before each test, and after in case of other // tests using these functions. \mod_forum\subscriptions::reset_forum_cache(); + parent::tearDown(); } /** diff --git a/mod/forum/tests/externallib_test.php b/mod/forum/tests/externallib_test.php index 8054fb0d9e8..9a94fcd14c2 100644 --- a/mod/forum/tests/externallib_test.php +++ b/mod/forum/tests/externallib_test.php @@ -42,6 +42,7 @@ final class externallib_test extends externallib_advanced_testcase { */ protected function setUp(): void { global $CFG; + parent::setUp(); // We must clear the subscription caches. This has to be done both before each test, and after in case of other // tests using these functions. @@ -54,6 +55,7 @@ final class externallib_test extends externallib_advanced_testcase { // We must clear the subscription caches. This has to be done both before each test, and after in case of other // tests using these functions. \mod_forum\subscriptions::reset_forum_cache(); + parent::tearDown(); } /** diff --git a/mod/forum/tests/generator_test.php b/mod/forum/tests/generator_test.php index daf9c01009d..94183e6acaa 100644 --- a/mod/forum/tests/generator_test.php +++ b/mod/forum/tests/generator_test.php @@ -27,6 +27,7 @@ namespace mod_forum; */ final class generator_test extends \advanced_testcase { public function setUp(): void { + parent::setUp(); // We must clear the subscription caches. This has to be done both before each test, and after in case of other // tests using these functions. \mod_forum\subscriptions::reset_forum_cache(); @@ -36,6 +37,7 @@ final class generator_test extends \advanced_testcase { // We must clear the subscription caches. This has to be done both before each test, and after in case of other // tests using these functions. \mod_forum\subscriptions::reset_forum_cache(); + parent::tearDown(); } public function test_generator(): void { diff --git a/mod/forum/tests/lib_test.php b/mod/forum/tests/lib_test.php index 5fbea990011..2fc6382975c 100644 --- a/mod/forum/tests/lib_test.php +++ b/mod/forum/tests/lib_test.php @@ -35,6 +35,7 @@ require_once($CFG->dirroot . '/rating/lib.php'); class lib_test extends \advanced_testcase { public function setUp(): void { + parent::setUp(); // We must clear the subscription caches. This has to be done both before each test, and after in case of other // tests using these functions. \mod_forum\subscriptions::reset_forum_cache(); @@ -44,6 +45,7 @@ class lib_test extends \advanced_testcase { // We must clear the subscription caches. This has to be done both before each test, and after in case of other // tests using these functions. \mod_forum\subscriptions::reset_forum_cache(); + parent::tearDown(); } public function test_forum_trigger_content_uploaded_event(): void { diff --git a/mod/forum/tests/mail_group_test.php b/mod/forum/tests/mail_group_test.php index fc51d89d812..3ca4ab671e6 100644 --- a/mod/forum/tests/mail_group_test.php +++ b/mod/forum/tests/mail_group_test.php @@ -51,6 +51,7 @@ class mail_group_test extends \advanced_testcase { public function setUp(): void { global $CFG; + parent::setUp(); // We must clear the subscription caches. This has to be done both before each test, and after in case of other // tests using these functions. @@ -81,6 +82,7 @@ class mail_group_test extends \advanced_testcase { $this->mailsink->clear(); $this->mailsink->close(); unset($this->mailsink); + parent::tearDown(); } /** diff --git a/mod/forum/tests/mail_test.php b/mod/forum/tests/mail_test.php index fe6f7f49425..6a844fce264 100644 --- a/mod/forum/tests/mail_test.php +++ b/mod/forum/tests/mail_test.php @@ -57,6 +57,7 @@ class mail_test extends \advanced_testcase { public function setUp(): void { global $CFG; + parent::setUp(); // We must clear the subscription caches. This has to be done both before each test, and after in case of other // tests using these functions. @@ -87,6 +88,7 @@ class mail_test extends \advanced_testcase { $this->mailsink->clear(); $this->mailsink->close(); unset($this->mailsink); + parent::tearDown(); } /** diff --git a/mod/forum/tests/maildigest_test.php b/mod/forum/tests/maildigest_test.php index b60498b5510..9c6f3be9b87 100644 --- a/mod/forum/tests/maildigest_test.php +++ b/mod/forum/tests/maildigest_test.php @@ -53,6 +53,7 @@ class maildigest_test extends \advanced_testcase { */ public function setUp(): void { global $CFG; + parent::setUp(); // Messaging is not compatible with transactions... $this->preventResetByRollback(); @@ -94,6 +95,7 @@ class maildigest_test extends \advanced_testcase { $this->mailsink->clear(); $this->mailsink->close(); + parent::tearDown(); } /** diff --git a/mod/forum/tests/managers_capability_test.php b/mod/forum/tests/managers_capability_test.php index 5d5c15bde39..6dcc3bda64c 100644 --- a/mod/forum/tests/managers_capability_test.php +++ b/mod/forum/tests/managers_capability_test.php @@ -79,6 +79,7 @@ class managers_capability_test extends \advanced_testcase { */ public function setUp(): void { global $DB; + parent::setUp(); // We must clear the subscription caches. This has to be done both before each test, and after in case of other // tests using these functions. @@ -113,6 +114,7 @@ class managers_capability_test extends \advanced_testcase { // We must clear the subscription caches. This has to be done both before each test, and after in case of other // tests using these functions. \mod_forum\subscriptions::reset_forum_cache(); + parent::tearDown(); } /** diff --git a/mod/forum/tests/privacy/provider_test.php b/mod/forum/tests/privacy/provider_test.php index 11f18124b65..cd1e751139f 100644 --- a/mod/forum/tests/privacy/provider_test.php +++ b/mod/forum/tests/privacy/provider_test.php @@ -58,6 +58,7 @@ class provider_test extends \core_privacy\tests\provider_testcase { * Test setUp. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); } diff --git a/mod/forum/tests/private_replies_test.php b/mod/forum/tests/private_replies_test.php index ac320d90e1d..06d2df91b70 100644 --- a/mod/forum/tests/private_replies_test.php +++ b/mod/forum/tests/private_replies_test.php @@ -40,6 +40,7 @@ class private_replies_test extends \advanced_testcase { * Setup before tests. */ public function setUp(): void { + parent::setUp(); // We must clear the subscription caches. This has to be done both before each test, and after in case of other // tests using these functions. \mod_forum\subscriptions::reset_forum_cache(); @@ -52,6 +53,7 @@ class private_replies_test extends \advanced_testcase { // We must clear the subscription caches. This has to be done both before each test, and after in case of other // tests using these functions. \mod_forum\subscriptions::reset_forum_cache(); + parent::tearDown(); } /** diff --git a/mod/forum/tests/qanda_test.php b/mod/forum/tests/qanda_test.php index ff8ff6b6941..6dfc1aa045d 100644 --- a/mod/forum/tests/qanda_test.php +++ b/mod/forum/tests/qanda_test.php @@ -52,6 +52,7 @@ class qanda_test extends \advanced_testcase { public function setUp(): void { global $CFG; + parent::setUp(); // We must clear the subscription caches. This has to be done both before each test, and after in case of other // tests using these functions. @@ -82,6 +83,7 @@ class qanda_test extends \advanced_testcase { $this->mailsink->clear(); $this->mailsink->close(); unset($this->mailsink); + parent::tearDown(); } /** diff --git a/mod/forum/tests/search/search_test.php b/mod/forum/tests/search/search_test.php index 5c9678881b7..8295a7726ae 100644 --- a/mod/forum/tests/search/search_test.php +++ b/mod/forum/tests/search/search_test.php @@ -48,6 +48,7 @@ class search_test extends \advanced_testcase { protected $forumpostareaid = null; public function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); set_config('enableglobalsearch', true); diff --git a/mod/forum/tests/subscriptions_test.php b/mod/forum/tests/subscriptions_test.php index e06c3d6f3a7..8817d208c93 100644 --- a/mod/forum/tests/subscriptions_test.php +++ b/mod/forum/tests/subscriptions_test.php @@ -41,6 +41,7 @@ class subscriptions_test extends \advanced_testcase { */ public function setUp(): void { global $DB; + parent::setUp(); // We must clear the subscription caches. This has to be done both before each test, and after in case of other // tests using these functions. @@ -56,6 +57,7 @@ class subscriptions_test extends \advanced_testcase { // tests using these functions. \mod_forum\subscriptions::reset_forum_cache(); \mod_forum\subscriptions::reset_discussion_cache(); + parent::tearDown(); } /** diff --git a/mod/forum/tests/vaults_discussion_list_test.php b/mod/forum/tests/vaults_discussion_list_test.php index 4df2595b248..639fab10597 100644 --- a/mod/forum/tests/vaults_discussion_list_test.php +++ b/mod/forum/tests/vaults_discussion_list_test.php @@ -44,6 +44,7 @@ class vaults_discussion_list_test extends \advanced_testcase { * Set up function for tests. */ public function setUp(): void { + parent::setUp(); $vaultfactory = \mod_forum\local\container::get_vault_factory(); $this->vault = $vaultfactory->get_discussions_in_forum_vault(); } diff --git a/mod/forum/tests/vaults_discussion_test.php b/mod/forum/tests/vaults_discussion_test.php index 3aa2a932b4e..44c2b8ce92d 100644 --- a/mod/forum/tests/vaults_discussion_test.php +++ b/mod/forum/tests/vaults_discussion_test.php @@ -40,6 +40,7 @@ class vaults_discussion_test extends \advanced_testcase { * Set up function for tests. */ public function setUp(): void { + parent::setUp(); $vaultfactory = \mod_forum\local\container::get_vault_factory(); $this->vault = $vaultfactory->get_discussion_vault(); } diff --git a/mod/forum/tests/vaults_post_test.php b/mod/forum/tests/vaults_post_test.php index 8ae46f0c4c4..7af3bd98d64 100644 --- a/mod/forum/tests/vaults_post_test.php +++ b/mod/forum/tests/vaults_post_test.php @@ -41,6 +41,7 @@ class vaults_post_test extends \advanced_testcase { * Set up function for tests. */ public function setUp(): void { + parent::setUp(); $vaultfactory = \mod_forum\local\container::get_vault_factory(); $this->vault = $vaultfactory->get_post_vault(); } @@ -50,6 +51,7 @@ class vaults_post_test extends \advanced_testcase { */ public function tearDown(): void { unset($this->vault); + parent::tearDown(); } /** diff --git a/mod/glossary/tests/event/events_test.php b/mod/glossary/tests/event/events_test.php index 22287ab82e8..5fda84ac3fa 100644 --- a/mod/glossary/tests/event/events_test.php +++ b/mod/glossary/tests/event/events_test.php @@ -36,6 +36,7 @@ namespace mod_glossary\event; class events_test extends \advanced_testcase { public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); } diff --git a/mod/glossary/tests/privacy/provider_test.php b/mod/glossary/tests/privacy/provider_test.php index bf9a25092a0..7e2ffe3fe25 100644 --- a/mod/glossary/tests/privacy/provider_test.php +++ b/mod/glossary/tests/privacy/provider_test.php @@ -61,6 +61,7 @@ class provider_test extends \core_privacy\tests\provider_testcase { * {@inheritdoc} */ protected function setUp(): void { + parent::setUp(); $this->resetAfterTest(); global $DB; diff --git a/mod/glossary/tests/search/search_test.php b/mod/glossary/tests/search/search_test.php index 775570e0f40..522ab046eda 100644 --- a/mod/glossary/tests/search/search_test.php +++ b/mod/glossary/tests/search/search_test.php @@ -47,6 +47,7 @@ class search_test extends \advanced_testcase { protected $entryareaid = null; public function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); set_config('enableglobalsearch', true); diff --git a/mod/h5pactivity/tests/lib_test.php b/mod/h5pactivity/tests/lib_test.php index 217eebce94e..038cb084907 100644 --- a/mod/h5pactivity/tests/lib_test.php +++ b/mod/h5pactivity/tests/lib_test.php @@ -35,6 +35,7 @@ class lib_test extends advanced_testcase { public static function setUpBeforeClass(): void { global $CFG; require_once("{$CFG->dirroot}/mod/h5pactivity/lib.php"); + parent::setUpBeforeClass(); } /** diff --git a/mod/h5pactivity/tests/xapi/handler_test.php b/mod/h5pactivity/tests/xapi/handler_test.php index 5fdca872aab..82ff40a23cb 100644 --- a/mod/h5pactivity/tests/xapi/handler_test.php +++ b/mod/h5pactivity/tests/xapi/handler_test.php @@ -43,6 +43,7 @@ class handler_test extends \advanced_testcase { public static function setUpBeforeClass(): void { global $CFG; require_once($CFG->dirroot.'/lib/xapi/tests/helper.php'); + parent::setUpBeforeClass(); } /** diff --git a/mod/label/tests/lib_test.php b/mod/label/tests/lib_test.php index 8a92f046c16..17b6bcb7c21 100644 --- a/mod/label/tests/lib_test.php +++ b/mod/label/tests/lib_test.php @@ -30,6 +30,7 @@ class lib_test extends \advanced_testcase { * Set up. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); $this->setAdminUser(); } diff --git a/mod/lesson/tests/event/events_test.php b/mod/lesson/tests/event/events_test.php index 925da23cc8c..6259aa0bd8f 100644 --- a/mod/lesson/tests/event/events_test.php +++ b/mod/lesson/tests/event/events_test.php @@ -47,6 +47,7 @@ class events_test extends \advanced_testcase { * This is executed before running any test in this file. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); $this->setAdminUser(); diff --git a/mod/lesson/tests/external/external_test.php b/mod/lesson/tests/external/external_test.php index 92900b68129..64a98f85e71 100644 --- a/mod/lesson/tests/external/external_test.php +++ b/mod/lesson/tests/external/external_test.php @@ -109,6 +109,7 @@ class external_test extends externallib_advanced_testcase { */ public function setUp(): void { global $DB; + parent::setUp(); $this->resetAfterTest(); $this->setAdminUser(); diff --git a/mod/lesson/tests/privacy/provider_test.php b/mod/lesson/tests/privacy/provider_test.php index 316572bab94..34eb7107edb 100644 --- a/mod/lesson/tests/privacy/provider_test.php +++ b/mod/lesson/tests/privacy/provider_test.php @@ -48,6 +48,7 @@ class provider_test extends provider_testcase { public function setUp(): void { global $PAGE; + parent::setUp(); $this->setAdminUser(); // The data generator complains without this. $this->resetAfterTest(); $PAGE->get_renderer('core'); diff --git a/mod/lti/service/gradebookservices/tests/gradebookservices_test.php b/mod/lti/service/gradebookservices/tests/gradebookservices_test.php index 3e083f50ced..d6225119a18 100644 --- a/mod/lti/service/gradebookservices/tests/gradebookservices_test.php +++ b/mod/lti/service/gradebookservices/tests/gradebookservices_test.php @@ -34,6 +34,7 @@ class gradebookservices_test extends \advanced_testcase { public static function setUpBeforeClass(): void { global $CFG; require_once($CFG->dirroot . '/mod/lti/locallib.php'); + parent::setUpBeforeClass(); } /** diff --git a/mod/lti/service/gradebookservices/tests/privacy/provider_test.php b/mod/lti/service/gradebookservices/tests/privacy/provider_test.php index 2f88dfea624..3de1c4311f5 100644 --- a/mod/lti/service/gradebookservices/tests/privacy/provider_test.php +++ b/mod/lti/service/gradebookservices/tests/privacy/provider_test.php @@ -38,6 +38,7 @@ class provider_test extends provider_testcase { * Basic setup for these tests. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); } diff --git a/mod/lti/service/gradebookservices/tests/task/cleanup_test.php b/mod/lti/service/gradebookservices/tests/task/cleanup_test.php index 306c06dce98..e9fe4f6d518 100644 --- a/mod/lti/service/gradebookservices/tests/task/cleanup_test.php +++ b/mod/lti/service/gradebookservices/tests/task/cleanup_test.php @@ -32,6 +32,7 @@ class cleanup_test extends \advanced_testcase { * This is executed before running any test in this file. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); } diff --git a/mod/lti/service/memberships/tests/privacy/provider_test.php b/mod/lti/service/memberships/tests/privacy/provider_test.php index 5fc31e51f58..f56fd986b10 100644 --- a/mod/lti/service/memberships/tests/privacy/provider_test.php +++ b/mod/lti/service/memberships/tests/privacy/provider_test.php @@ -38,6 +38,7 @@ class provider_test extends provider_testcase { * Basic setup for these tests. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); } diff --git a/mod/lti/tests/external/get_tool_types_and_proxies_count_test.php b/mod/lti/tests/external/get_tool_types_and_proxies_count_test.php index 0cc58f9a650..3a61f8093aa 100644 --- a/mod/lti/tests/external/get_tool_types_and_proxies_count_test.php +++ b/mod/lti/tests/external/get_tool_types_and_proxies_count_test.php @@ -38,6 +38,7 @@ class get_tool_types_and_proxies_count_test extends \mod_lti_testcase { * This method runs before every test. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); $this->setAdminUser(); } diff --git a/mod/lti/tests/external/get_tool_types_and_proxies_test.php b/mod/lti/tests/external/get_tool_types_and_proxies_test.php index cca0c627cec..76505b9cd41 100644 --- a/mod/lti/tests/external/get_tool_types_and_proxies_test.php +++ b/mod/lti/tests/external/get_tool_types_and_proxies_test.php @@ -38,6 +38,7 @@ class get_tool_types_and_proxies_test extends \mod_lti_testcase { * This method runs before every test. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); $this->setAdminUser(); } diff --git a/mod/lti/tests/externallib_test.php b/mod/lti/tests/externallib_test.php index 301c6d3b7fd..ac36fb51266 100644 --- a/mod/lti/tests/externallib_test.php +++ b/mod/lti/tests/externallib_test.php @@ -43,6 +43,7 @@ class externallib_test extends mod_lti_testcase { * Set up for every test */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); } diff --git a/mod/lti/tests/lib_test.php b/mod/lti/tests/lib_test.php index 9e2faab19a3..414bb861508 100644 --- a/mod/lti/tests/lib_test.php +++ b/mod/lti/tests/lib_test.php @@ -45,6 +45,7 @@ class lib_test extends \advanced_testcase { public static function setUpBeforeClass(): void { global $CFG; require_once($CFG->dirroot . '/mod/lti/lib.php'); + parent::setUpBeforeClass(); } /** diff --git a/mod/lti/tests/task/clean_access_tokens_test.php b/mod/lti/tests/task/clean_access_tokens_test.php index 56396fca9d5..262baea42dd 100644 --- a/mod/lti/tests/task/clean_access_tokens_test.php +++ b/mod/lti/tests/task/clean_access_tokens_test.php @@ -32,6 +32,7 @@ class clean_access_tokens_test extends \advanced_testcase { * This is executed before running any test in this file. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); } diff --git a/mod/page/tests/lib_test.php b/mod/page/tests/lib_test.php index 6d18025e5a3..db31fd637d0 100644 --- a/mod/page/tests/lib_test.php +++ b/mod/page/tests/lib_test.php @@ -46,6 +46,7 @@ class lib_test extends \advanced_testcase { public static function setUpBeforeClass(): void { global $CFG; require_once($CFG->dirroot . '/mod/page/lib.php'); + parent::setUpBeforeClass(); } /** diff --git a/mod/quiz/accessrule/seb/tests/rule_test.php b/mod/quiz/accessrule/seb/tests/rule_test.php index 5986a6dc3c8..91b639fd22c 100644 --- a/mod/quiz/accessrule/seb/tests/rule_test.php +++ b/mod/quiz/accessrule/seb/tests/rule_test.php @@ -53,6 +53,7 @@ class rule_test extends \advanced_testcase { if (!empty($this->quiz)) { unset($SESSION->quizaccess_seb_access); } + parent::tearDown(); } /** diff --git a/mod/quiz/report/statistics/tests/quiz_statistics_report_test.php b/mod/quiz/report/statistics/tests/quiz_statistics_report_test.php index 8e32faee8b2..b24c71bd1d6 100644 --- a/mod/quiz/report/statistics/tests/quiz_statistics_report_test.php +++ b/mod/quiz/report/statistics/tests/quiz_statistics_report_test.php @@ -59,6 +59,7 @@ class quiz_statistics_report_test extends \advanced_testcase { */ public function setUp(): void { global $CFG; + parent::setUp(); self::$lockdb = \moodle_database::get_driver_instance($CFG->dbtype, $CFG->dblibrary); self::$lockdb->connect($CFG->dbhost, $CFG->dbuser, $CFG->dbpass, $CFG->dbname, $CFG->prefix, $CFG->dboptions); @@ -90,6 +91,7 @@ class quiz_statistics_report_test extends \advanced_testcase { self::$lockdb->dispose(); self::$lockdb = null; self::$lockfactory = null; + parent::tearDown(); } /** diff --git a/mod/quiz/tests/external/external_test.php b/mod/quiz/tests/external/external_test.php index 42a82c78131..b631879deae 100644 --- a/mod/quiz/tests/external/external_test.php +++ b/mod/quiz/tests/external/external_test.php @@ -119,6 +119,7 @@ class external_test extends externallib_advanced_testcase { */ public function setUp(): void { global $DB; + parent::setUp(); $this->resetAfterTest(); $this->setAdminUser(); diff --git a/mod/quiz/tests/quiz_notify_attempt_manual_grading_completed_test.php b/mod/quiz/tests/quiz_notify_attempt_manual_grading_completed_test.php index a46b5a67fea..7d0cdbbeb28 100644 --- a/mod/quiz/tests/quiz_notify_attempt_manual_grading_completed_test.php +++ b/mod/quiz/tests/quiz_notify_attempt_manual_grading_completed_test.php @@ -75,6 +75,7 @@ class quiz_notify_attempt_manual_grading_completed_test extends advanced_testcas */ public function setUp(): void { global $DB; + parent::setUp(); $this->resetAfterTest(); $this->setAdminUser(); diff --git a/mod/quiz/tests/repaginate_test.php b/mod/quiz/tests/repaginate_test.php index fffd2ab12e8..81a3791e54d 100644 --- a/mod/quiz/tests/repaginate_test.php +++ b/mod/quiz/tests/repaginate_test.php @@ -70,6 +70,7 @@ class repaginate_test extends \advanced_testcase { private $repaginate = null; public function setUp(): void { + parent::setUp(); $this->set_quiz_slots($this->get_quiz_object()->get_slots()); $this->repaginate = new mod_quiz_repaginate_testable(0, $this->quizslots); } diff --git a/mod/quiz/tests/restore_attempt_test.php b/mod/quiz/tests/restore_attempt_test.php index 5fd21c18c9b..5fcdad01031 100644 --- a/mod/quiz/tests/restore_attempt_test.php +++ b/mod/quiz/tests/restore_attempt_test.php @@ -37,6 +37,7 @@ class restore_attempt_test extends \advanced_testcase { global $CFG; require_once("{$CFG->dirroot}/backup/util/includes/restore_includes.php"); + parent::setUpBeforeClass(); } /** diff --git a/mod/resource/tests/event/events_test.php b/mod/resource/tests/event/events_test.php index eb7ba3b9912..e4f5fd2f055 100644 --- a/mod/resource/tests/event/events_test.php +++ b/mod/resource/tests/event/events_test.php @@ -37,6 +37,7 @@ class events_test extends \advanced_testcase { * Setup is called before calling test case. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); // Must be a non-guest user to create resources. diff --git a/mod/resource/tests/lib_test.php b/mod/resource/tests/lib_test.php index 7a1143d8154..d5317e6d87c 100644 --- a/mod/resource/tests/lib_test.php +++ b/mod/resource/tests/lib_test.php @@ -46,6 +46,7 @@ class lib_test extends \advanced_testcase { public static function setUpBeforeClass(): void { global $CFG; require_once($CFG->dirroot . '/mod/resource/lib.php'); + parent::setUpBeforeClass(); } /** diff --git a/mod/resource/tests/search/search_test.php b/mod/resource/tests/search/search_test.php index c3579eb7c49..339fd7ce898 100644 --- a/mod/resource/tests/search/search_test.php +++ b/mod/resource/tests/search/search_test.php @@ -46,6 +46,7 @@ class search_test extends \advanced_testcase { protected $resourceareaid = null; public function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); set_config('enableglobalsearch', true); diff --git a/mod/scorm/report/basic/tests/privacy/provider_test.php b/mod/scorm/report/basic/tests/privacy/provider_test.php index 015305c78da..ed6279c1a86 100644 --- a/mod/scorm/report/basic/tests/privacy/provider_test.php +++ b/mod/scorm/report/basic/tests/privacy/provider_test.php @@ -41,6 +41,7 @@ class provider_test extends \core_privacy\tests\provider_testcase { * Basic setup for these tests. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); } diff --git a/mod/scorm/report/interactions/tests/privacy/provider_test.php b/mod/scorm/report/interactions/tests/privacy/provider_test.php index 858c851b015..6467edb361f 100644 --- a/mod/scorm/report/interactions/tests/privacy/provider_test.php +++ b/mod/scorm/report/interactions/tests/privacy/provider_test.php @@ -41,6 +41,7 @@ class provider_test extends \core_privacy\tests\provider_testcase { * Basic setup for these tests. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); } diff --git a/mod/scorm/report/objectives/tests/privacy/provider_test.php b/mod/scorm/report/objectives/tests/privacy/provider_test.php index 0159f487c3f..7b8a40593f1 100644 --- a/mod/scorm/report/objectives/tests/privacy/provider_test.php +++ b/mod/scorm/report/objectives/tests/privacy/provider_test.php @@ -41,6 +41,7 @@ class provider_test extends \core_privacy\tests\provider_testcase { * Basic setup for these tests. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); } diff --git a/mod/scorm/tests/event/events_test.php b/mod/scorm/tests/event/events_test.php index 90d82444f11..947c2cebd2e 100644 --- a/mod/scorm/tests/event/events_test.php +++ b/mod/scorm/tests/event/events_test.php @@ -52,6 +52,7 @@ class events_test extends \advanced_testcase { protected $eventcm; protected function setUp(): void { + parent::setUp(); $this->setAdminUser(); $this->eventcourse = $this->getDataGenerator()->create_course(); $this->eventuser = $this->getDataGenerator()->create_user(); diff --git a/mod/scorm/tests/externallib_test.php b/mod/scorm/tests/externallib_test.php index 3f7fbc5fa0a..cbf019ec1aa 100644 --- a/mod/scorm/tests/externallib_test.php +++ b/mod/scorm/tests/externallib_test.php @@ -67,6 +67,7 @@ class externallib_test extends externallib_advanced_testcase { */ public function setUp(): void { global $DB, $CFG; + parent::setUp(); $this->resetAfterTest(); $this->setAdminUser(); diff --git a/mod/scorm/tests/lib_test.php b/mod/scorm/tests/lib_test.php index 01fb3cd6d5a..0206b68dcfd 100644 --- a/mod/scorm/tests/lib_test.php +++ b/mod/scorm/tests/lib_test.php @@ -74,6 +74,7 @@ class lib_test extends \advanced_testcase { */ public function setUp(): void { global $DB; + parent::setUp(); $this->resetAfterTest(); $this->setAdminUser(); diff --git a/mod/scorm/tests/locallib_test.php b/mod/scorm/tests/locallib_test.php index b120f96671c..ef1f7d650e7 100644 --- a/mod/scorm/tests/locallib_test.php +++ b/mod/scorm/tests/locallib_test.php @@ -41,6 +41,7 @@ require_once($CFG->dirroot . '/mod/scorm/lib.php'); class locallib_test extends \advanced_testcase { public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); } diff --git a/mod/survey/tests/event/events_test.php b/mod/survey/tests/event/events_test.php index cc25489f45c..1c232a066c0 100644 --- a/mod/survey/tests/event/events_test.php +++ b/mod/survey/tests/event/events_test.php @@ -37,6 +37,7 @@ class events_test extends \advanced_testcase { * Setup. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); // Survey module is disabled by default, enable it for testing. $manager = \core_plugin_manager::resolve_plugininfo_class('mod'); diff --git a/mod/survey/tests/externallib_test.php b/mod/survey/tests/externallib_test.php index d2c182217ad..b065e7da52b 100644 --- a/mod/survey/tests/externallib_test.php +++ b/mod/survey/tests/externallib_test.php @@ -67,6 +67,7 @@ class externallib_test extends externallib_advanced_testcase { */ public function setUp(): void { global $DB; + parent::setUp(); $this->resetAfterTest(); $this->setAdminUser(); diff --git a/mod/survey/tests/generator_test.php b/mod/survey/tests/generator_test.php index a038c4add09..1854b0b53f3 100644 --- a/mod/survey/tests/generator_test.php +++ b/mod/survey/tests/generator_test.php @@ -30,6 +30,7 @@ class generator_test extends \advanced_testcase { * Setup testcase. */ public function setUp(): void { + parent::setUp(); // Survey module is disabled by default, enable it for testing. $manager = \core_plugin_manager::resolve_plugininfo_class('mod'); $manager::enable_plugin('survey', 1); diff --git a/mod/survey/tests/lib_test.php b/mod/survey/tests/lib_test.php index eb5704f9a09..30e5135afcb 100644 --- a/mod/survey/tests/lib_test.php +++ b/mod/survey/tests/lib_test.php @@ -46,12 +46,14 @@ class lib_test extends \advanced_testcase { public static function setUpBeforeClass(): void { global $CFG; require_once($CFG->dirroot . '/mod/survey/lib.php'); + parent::setUpBeforeClass(); } /** * Setup testcase. */ public function setUp(): void { + parent::setUp(); // Survey module is disabled by default, enable it for testing. $manager = \core_plugin_manager::resolve_plugininfo_class('mod'); $manager::enable_plugin('survey', 1); diff --git a/mod/survey/tests/privacy/provider_test.php b/mod/survey/tests/privacy/provider_test.php index f8d50e9fb7c..356aac1facb 100644 --- a/mod/survey/tests/privacy/provider_test.php +++ b/mod/survey/tests/privacy/provider_test.php @@ -50,6 +50,7 @@ class provider_test extends provider_testcase { public function setUp(): void { global $PAGE; + parent::setUp(); $this->resetAfterTest(); $PAGE->get_renderer('core'); diff --git a/mod/survey/tests/search/search_test.php b/mod/survey/tests/search/search_test.php index 0144108c594..6f72a731aeb 100644 --- a/mod/survey/tests/search/search_test.php +++ b/mod/survey/tests/search/search_test.php @@ -43,6 +43,7 @@ class search_test extends \advanced_testcase { * Setup testcase. */ public function setUp(): void { + parent::setUp(); // Survey module is disabled by default, enable it for testing. $manager = \core_plugin_manager::resolve_plugininfo_class('mod'); $manager::enable_plugin('survey', 1); diff --git a/mod/url/tests/lib_test.php b/mod/url/tests/lib_test.php index b3a676a6b8f..6fa432cac73 100644 --- a/mod/url/tests/lib_test.php +++ b/mod/url/tests/lib_test.php @@ -45,6 +45,7 @@ class lib_test extends \advanced_testcase { global $CFG; require_once($CFG->dirroot . '/mod/url/lib.php'); require_once($CFG->dirroot . '/mod/url/locallib.php'); + parent::setUpBeforeClass(); } /** diff --git a/mod/wiki/tests/event/events_test.php b/mod/wiki/tests/event/events_test.php index bbf7b9a08f7..de643779dbb 100644 --- a/mod/wiki/tests/event/events_test.php +++ b/mod/wiki/tests/event/events_test.php @@ -48,6 +48,7 @@ class events_test extends \advanced_testcase { */ public function setUp(): void { global $DB; + parent::setUp(); $this->resetAfterTest(); // Create course and wiki. diff --git a/mod/wiki/tests/externallib_test.php b/mod/wiki/tests/externallib_test.php index c7832fe54d9..e56d31675f5 100644 --- a/mod/wiki/tests/externallib_test.php +++ b/mod/wiki/tests/externallib_test.php @@ -148,6 +148,7 @@ class externallib_test extends externallib_advanced_testcase { */ public function setUp(): void { global $DB; + parent::setUp(); $this->resetAfterTest(); $this->setAdminUser(); diff --git a/mod/wiki/tests/privacy/provider_test.php b/mod/wiki/tests/privacy/provider_test.php index 2a442027468..d09131a896a 100644 --- a/mod/wiki/tests/privacy/provider_test.php +++ b/mod/wiki/tests/privacy/provider_test.php @@ -74,6 +74,7 @@ class provider_test extends provider_testcase { */ public function setUp(): void { global $DB; + parent::setUp(); $this->resetAfterTest(); $dg = $this->getDataGenerator(); diff --git a/mod/wiki/tests/search/search_test.php b/mod/wiki/tests/search/search_test.php index c91457d4712..bd974cf51ab 100644 --- a/mod/wiki/tests/search/search_test.php +++ b/mod/wiki/tests/search/search_test.php @@ -45,6 +45,7 @@ class search_test extends \advanced_testcase { protected $wikicollabpageareaid = null; public function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); $this->setAdminUser(); set_config('enableglobalsearch', true); diff --git a/mod/workshop/tests/external/external_test.php b/mod/workshop/tests/external/external_test.php index c2a5953fbc5..944cbf3f979 100644 --- a/mod/workshop/tests/external/external_test.php +++ b/mod/workshop/tests/external/external_test.php @@ -79,6 +79,7 @@ class external_test extends externallib_advanced_testcase { */ public function setUp(): void { global $DB; + parent::setUp(); $this->resetAfterTest(); $this->setAdminUser(); diff --git a/mod/workshop/tests/privacy/provider_test.php b/mod/workshop/tests/privacy/provider_test.php index dc5104a6534..da76a3cc4d0 100644 --- a/mod/workshop/tests/privacy/provider_test.php +++ b/mod/workshop/tests/privacy/provider_test.php @@ -124,6 +124,7 @@ class provider_test extends provider_testcase { */ protected function setUp(): void { global $DB; + parent::setUp(); $this->resetAfterTest(); $this->setAdminUser(); diff --git a/my/tests/event/events_test.php b/my/tests/event/events_test.php index b743890ef0a..aff84243c93 100644 --- a/my/tests/event/events_test.php +++ b/my/tests/event/events_test.php @@ -37,6 +37,7 @@ class events_test extends \advanced_testcase { */ protected function setUp(): void { global $USER; + parent::setUp(); $this->resetAfterTest(); diff --git a/my/tests/external/view_page_test.php b/my/tests/external/view_page_test.php index 0e8fca66962..c60b525a480 100644 --- a/my/tests/external/view_page_test.php +++ b/my/tests/external/view_page_test.php @@ -40,6 +40,7 @@ class view_page_test extends externallib_advanced_testcase { * Set up for every test. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); } diff --git a/notes/tests/event/events_test.php b/notes/tests/event/events_test.php index 50bb407ccd8..6d561bfa630 100644 --- a/notes/tests/event/events_test.php +++ b/notes/tests/event/events_test.php @@ -43,6 +43,7 @@ class events_test extends \advanced_testcase { public function setUp(): void { global $DB; + parent::setUp(); $this->resetAfterTest(); $this->setAdminUser(); diff --git a/notes/tests/lib_test.php b/notes/tests/lib_test.php index c7638803af7..ce6cbb878d4 100644 --- a/notes/tests/lib_test.php +++ b/notes/tests/lib_test.php @@ -52,6 +52,7 @@ class lib_test extends \advanced_testcase { private $tree; public function setUp(): void { + parent::setUp(); $this->user = $this->getDataGenerator()->create_user(); $this->course = $this->getDataGenerator()->create_course(); $this->tree = new \core_user\output\myprofile\tree(); diff --git a/notes/tests/reportbuilder/datasource/notes_test.php b/notes/tests/reportbuilder/datasource/notes_test.php index 9ddf227fd90..8c64498d90b 100644 --- a/notes/tests/reportbuilder/datasource/notes_test.php +++ b/notes/tests/reportbuilder/datasource/notes_test.php @@ -44,6 +44,7 @@ class notes_test extends core_reportbuilder_testcase { public static function setUpBeforeClass(): void { global $CFG; require_once("{$CFG->dirroot}/notes/lib.php"); + parent::setUpBeforeClass(); } /** diff --git a/privacy/tests/manager_test.php b/privacy/tests/manager_test.php index 67310f2a426..cd65efa10b7 100644 --- a/privacy/tests/manager_test.php +++ b/privacy/tests/manager_test.php @@ -41,6 +41,7 @@ class manager_test extends \advanced_testcase { */ public function tearDown(): void { \core_privacy\local\request\writer::reset(); + parent::tearDown(); } /** diff --git a/privacy/tests/writer_test.php b/privacy/tests/writer_test.php index dc8638c4ac1..28cb659d896 100644 --- a/privacy/tests/writer_test.php +++ b/privacy/tests/writer_test.php @@ -47,6 +47,7 @@ class writer_test extends advanced_testcase { */ public function tearDown(): void { writer::reset(); + parent::tearDown(); } /** diff --git a/question/bank/comment/tests/event/comment_created_deleted_test.php b/question/bank/comment/tests/event/comment_created_deleted_test.php index f169af8770c..7b72021c7ad 100644 --- a/question/bank/comment/tests/event/comment_created_deleted_test.php +++ b/question/bank/comment/tests/event/comment_created_deleted_test.php @@ -52,6 +52,7 @@ class comment_created_deleted_test extends advanced_testcase { public function setUp(): void { global $CFG; require_once($CFG->dirroot . '/comment/lib.php'); + parent::setUp(); $this->resetAfterTest(); $this->setAdminUser(); diff --git a/question/bank/comment/tests/privacy/provider_test.php b/question/bank/comment/tests/privacy/provider_test.php index ffe903849ee..9a1c1c40377 100644 --- a/question/bank/comment/tests/privacy/provider_test.php +++ b/question/bank/comment/tests/privacy/provider_test.php @@ -54,6 +54,7 @@ class provider_test extends \core_privacy\tests\provider_testcase { */ protected function setUp(): void { global $DB; + parent::setUp(); $this->resetAfterTest(); $this->setAdminUser(); diff --git a/question/bank/history/tests/helper_test.php b/question/bank/history/tests/helper_test.php index 9694f184661..60206e32671 100644 --- a/question/bank/history/tests/helper_test.php +++ b/question/bank/history/tests/helper_test.php @@ -54,6 +54,7 @@ class helper_test extends \advanced_testcase { * This is executed before running any test in this file. */ public function setUp(): void { + parent::setUp(); $this->setAdminUser(); $generator = $this->getDataGenerator(); $questiongenerator = $generator->get_plugin_generator('core_question'); diff --git a/question/bank/previewquestion/tests/qbank_preview_helper_test.php b/question/bank/previewquestion/tests/qbank_preview_helper_test.php index 35dc14c518c..956e216379d 100644 --- a/question/bank/previewquestion/tests/qbank_preview_helper_test.php +++ b/question/bank/previewquestion/tests/qbank_preview_helper_test.php @@ -66,6 +66,7 @@ class qbank_preview_helper_test extends \advanced_testcase { */ public function setUp(): void { global $USER; + parent::setUp(); $this->resetAfterTest(); $this->setAdminUser(); $generator = $this->getDataGenerator(); diff --git a/question/bank/tagquestion/tests/external/submit_tags_test.php b/question/bank/tagquestion/tests/external/submit_tags_test.php index 47904472b7c..4113a06bc91 100644 --- a/question/bank/tagquestion/tests/external/submit_tags_test.php +++ b/question/bank/tagquestion/tests/external/submit_tags_test.php @@ -45,6 +45,7 @@ class submit_tags_test extends \externallib_advanced_testcase { */ public function setUp(): void { global $DB; + parent::setUp(); $this->resetAfterTest(); $this->setAdminUser(); diff --git a/question/engine/tests/question_engine_test.php b/question/engine/tests/question_engine_test.php index 10b81ecaedb..ca343edfc61 100644 --- a/question/engine/tests/question_engine_test.php +++ b/question/engine/tests/question_engine_test.php @@ -45,6 +45,7 @@ class question_engine_test extends advanced_testcase { global $CFG; require_once("{$CFG->dirroot}/question/engine/lib.php"); + parent::setUpBeforeClass(); } /** diff --git a/question/engine/tests/questionattempt_test.php b/question/engine/tests/questionattempt_test.php index 5bca0d39bac..513f67cf1ef 100644 --- a/question/engine/tests/questionattempt_test.php +++ b/question/engine/tests/questionattempt_test.php @@ -46,6 +46,7 @@ class questionattempt_test extends \advanced_testcase { private $qa; protected function setUp(): void { + parent::setUp(); $this->question = \test_question_maker::make_question('description'); $this->question->defaultmark = 3; $this->usageid = 13; diff --git a/question/engine/tests/questionattempt_with_steps_test.php b/question/engine/tests/questionattempt_with_steps_test.php index 9c7360d657f..7a10d6c2bd3 100644 --- a/question/engine/tests/questionattempt_with_steps_test.php +++ b/question/engine/tests/questionattempt_with_steps_test.php @@ -43,6 +43,7 @@ class questionattempt_with_steps_test extends \advanced_testcase { private $qa; protected function setUp(): void { + parent::setUp(); $this->question = \test_question_maker::make_question('description'); $this->qa = new testable_question_attempt($this->question, 0, null, 2); for ($i = 0; $i < 3; $i++) { @@ -53,6 +54,7 @@ class questionattempt_with_steps_test extends \advanced_testcase { protected function tearDown(): void { $this->qa = null; + parent::tearDown(); } public function test_get_step_before_start(): void { diff --git a/question/engine/tests/questionattemptiterator_test.php b/question/engine/tests/questionattemptiterator_test.php index 14e00362498..98b93d49e3f 100644 --- a/question/engine/tests/questionattemptiterator_test.php +++ b/question/engine/tests/questionattemptiterator_test.php @@ -38,6 +38,7 @@ class questionattemptiterator_test extends \advanced_testcase { private $iterator; protected function setUp(): void { + parent::setUp(); $this->quba = question_engine::make_questions_usage_by_activity('unit_test', \context_system::instance()); $this->quba->set_preferred_behaviour('deferredfeedback'); @@ -54,6 +55,7 @@ class questionattemptiterator_test extends \advanced_testcase { protected function tearDown(): void { $this->quba = null; $this->iterator = null; + parent::tearDown(); } public function test_foreach_loop(): void { diff --git a/question/engine/tests/questionattemptstepiterator_test.php b/question/engine/tests/questionattemptstepiterator_test.php index 0756d126265..a99c65647c2 100644 --- a/question/engine/tests/questionattemptstepiterator_test.php +++ b/question/engine/tests/questionattemptstepiterator_test.php @@ -38,6 +38,7 @@ class questionattemptstepiterator_test extends \advanced_testcase { private $iterator; protected function setUp(): void { + parent::setUp(); $question = \test_question_maker::make_question('description'); $this->qa = new testable_question_attempt($question, 0); for ($i = 0; $i < 3; $i++) { @@ -50,6 +51,7 @@ class questionattemptstepiterator_test extends \advanced_testcase { protected function tearDown(): void { $this->qa = null; $this->iterator = null; + parent::tearDown(); } public function test_foreach_loop(): void { diff --git a/question/engine/tests/questionusage_autosave_test.php b/question/engine/tests/questionusage_autosave_test.php index 185ca19e4d0..f33f94042cb 100644 --- a/question/engine/tests/questionusage_autosave_test.php +++ b/question/engine/tests/questionusage_autosave_test.php @@ -747,5 +747,6 @@ class questionusage_autosave_test extends \qbehaviour_walkthrough_test_base { // This test relies on the destructor for the second DB connection being called before running the next test. // Without this change - there will be unit test failures on "some" DBs (MySQL). gc_collect_cycles(); + parent::tearDown(); } } diff --git a/question/engine/tests/unitofwork_test.php b/question/engine/tests/unitofwork_test.php index 8b62abb8e32..4c683813382 100644 --- a/question/engine/tests/unitofwork_test.php +++ b/question/engine/tests/unitofwork_test.php @@ -47,6 +47,7 @@ class unitofwork_test extends \data_loading_method_test_base { protected $observer; protected function setUp(): void { + parent::setUp(); // Create a usage in an initial state, with one shortanswer question added, // and attempted in interactive mode submitted responses 'toad' then 'frog'. // Then set it to use a new unit of work for any subsequent changes. @@ -65,6 +66,7 @@ class unitofwork_test extends \data_loading_method_test_base { public function tearDown(): void { question_bank::end_unit_test(); + parent::tearDown(); } protected function setup_initial_test_state($testdata) { diff --git a/question/tests/event/events_test.php b/question/tests/event/events_test.php index 371d4944082..3672dbabfbd 100644 --- a/question/tests/event/events_test.php +++ b/question/tests/event/events_test.php @@ -42,6 +42,7 @@ class events_test extends \advanced_testcase { * Tests set up. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); } diff --git a/question/tests/externallib_test.php b/question/tests/externallib_test.php index f475cdd8dc4..cf74e76664b 100644 --- a/question/tests/externallib_test.php +++ b/question/tests/externallib_test.php @@ -53,6 +53,7 @@ class externallib_test extends externallib_advanced_testcase { */ public function setUp(): void { global $DB; + parent::setUp(); $this->resetAfterTest(); $this->setAdminUser(); diff --git a/question/type/calculated/tests/question_type_test.php b/question/type/calculated/tests/question_type_test.php index f638bcdb29e..e10a8fc91f8 100644 --- a/question/type/calculated/tests/question_type_test.php +++ b/question/type/calculated/tests/question_type_test.php @@ -43,11 +43,13 @@ class question_type_test extends \advanced_testcase { protected $qtype; protected function setUp(): void { + parent::setUp(); $this->qtype = new qtype_calculated(); } protected function tearDown(): void { $this->qtype = null; + parent::tearDown(); } public function test_name(): void { diff --git a/question/type/calculatedsimple/tests/question_type_test.php b/question/type/calculatedsimple/tests/question_type_test.php index 3f2db4e008f..60b6ee4cb53 100644 --- a/question/type/calculatedsimple/tests/question_type_test.php +++ b/question/type/calculatedsimple/tests/question_type_test.php @@ -48,11 +48,13 @@ class question_type_test extends \advanced_testcase { protected $qtype; protected function setUp(): void { + parent::setUp(); $this->qtype = new qtype_calculatedsimple(); } protected function tearDown(): void { $this->qtype = null; + parent::tearDown(); } public function test_name(): void { diff --git a/question/type/ddimageortext/tests/question_type_test.php b/question/type/ddimageortext/tests/question_type_test.php index 116352f01da..1f8e6af93ed 100644 --- a/question/type/ddimageortext/tests/question_type_test.php +++ b/question/type/ddimageortext/tests/question_type_test.php @@ -37,11 +37,13 @@ class question_type_test extends \basic_testcase { protected $qtype; protected function setUp(): void { + parent::setUp(); $this->qtype = question_bank::get_qtype('ddimageortext');; } protected function tearDown(): void { $this->qtype = null; + parent::tearDown(); } public function test_name(): void { diff --git a/question/type/ddmarker/tests/question_type_test.php b/question/type/ddmarker/tests/question_type_test.php index eac56135479..397c0f63d97 100644 --- a/question/type/ddmarker/tests/question_type_test.php +++ b/question/type/ddmarker/tests/question_type_test.php @@ -37,11 +37,13 @@ class question_type_test extends \advanced_testcase { protected $qtype; protected function setUp(): void { + parent::setUp(); $this->qtype = question_bank::get_qtype('ddmarker');; } protected function tearDown(): void { $this->qtype = null; + parent::tearDown(); } public function test_name(): void { diff --git a/question/type/ddwtos/tests/question_type_test.php b/question/type/ddwtos/tests/question_type_test.php index 75c6c5e3745..81defc720f8 100644 --- a/question/type/ddwtos/tests/question_type_test.php +++ b/question/type/ddwtos/tests/question_type_test.php @@ -40,11 +40,13 @@ class question_type_test extends \question_testcase { protected $qtype; protected function setUp(): void { + parent::setUp(); $this->qtype = question_bank::get_qtype('ddwtos');; } protected function tearDown(): void { $this->qtype = null; + parent::tearDown(); } /** diff --git a/question/type/description/tests/question_type_test.php b/question/type/description/tests/question_type_test.php index b282af10478..9a28750cac8 100644 --- a/question/type/description/tests/question_type_test.php +++ b/question/type/description/tests/question_type_test.php @@ -39,11 +39,13 @@ class question_type_test extends \advanced_testcase { protected $qtype; protected function setUp(): void { + parent::setUp(); $this->qtype = new qtype_description(); } protected function tearDown(): void { $this->qtype = null; + parent::tearDown(); } public function test_name(): void { diff --git a/question/type/essay/tests/question_type_test.php b/question/type/essay/tests/question_type_test.php index a6737e6455d..bf1f766b179 100644 --- a/question/type/essay/tests/question_type_test.php +++ b/question/type/essay/tests/question_type_test.php @@ -35,11 +35,13 @@ class question_type_test extends \advanced_testcase { protected $qtype; protected function setUp(): void { + parent::setUp(); $this->qtype = new qtype_essay(); } protected function tearDown(): void { $this->qtype = null; + parent::tearDown(); } protected function get_test_question_data() { diff --git a/question/type/gapselect/tests/question_type_test.php b/question/type/gapselect/tests/question_type_test.php index f05e1aecd9f..137ad122b1a 100644 --- a/question/type/gapselect/tests/question_type_test.php +++ b/question/type/gapselect/tests/question_type_test.php @@ -39,11 +39,13 @@ class question_type_test extends \question_testcase { protected $qtype; protected function setUp(): void { + parent::setUp(); $this->qtype = question_bank::get_qtype('gapselect'); } protected function tearDown(): void { $this->qtype = null; + parent::tearDown(); } public function test_save_question(): void { diff --git a/question/type/match/tests/question_type_test.php b/question/type/match/tests/question_type_test.php index 969559b8e8f..51f6594b033 100644 --- a/question/type/match/tests/question_type_test.php +++ b/question/type/match/tests/question_type_test.php @@ -42,11 +42,13 @@ class question_type_test extends \advanced_testcase { protected $qtype; protected function setUp(): void { + parent::setUp(); $this->qtype = new qtype_match(); } protected function tearDown(): void { $this->qtype = null; + parent::tearDown(); } protected function get_test_question_data() { diff --git a/question/type/multianswer/tests/question_type_test.php b/question/type/multianswer/tests/question_type_test.php index 6cc5a6aba2e..6c25c8ea658 100644 --- a/question/type/multianswer/tests/question_type_test.php +++ b/question/type/multianswer/tests/question_type_test.php @@ -44,11 +44,13 @@ class question_type_test extends \advanced_testcase { protected $qtype; protected function setUp(): void { + parent::setUp(); $this->qtype = new qtype_multianswer(); } protected function tearDown(): void { $this->qtype = null; + parent::tearDown(); } protected function get_test_question_data() { diff --git a/question/type/multichoice/tests/question_type_test.php b/question/type/multichoice/tests/question_type_test.php index 147f61097f5..5e319bbb680 100644 --- a/question/type/multichoice/tests/question_type_test.php +++ b/question/type/multichoice/tests/question_type_test.php @@ -40,11 +40,13 @@ class question_type_test extends \advanced_testcase { protected $qtype; protected function setUp(): void { + parent::setUp(); $this->qtype = new qtype_multichoice(); } protected function tearDown(): void { $this->qtype = null; + parent::tearDown(); } public function test_name(): void { diff --git a/question/type/numerical/tests/answerprocessor_test.php b/question/type/numerical/tests/answerprocessor_test.php index fe3f9210f11..eb2271331f1 100644 --- a/question/type/numerical/tests/answerprocessor_test.php +++ b/question/type/numerical/tests/answerprocessor_test.php @@ -44,6 +44,7 @@ class answerprocessor_test extends \advanced_testcase { global $CFG; require_once("{$CFG->dirroot}/question/type/numerical/questiontype.php"); + parent::setUp(); } /** diff --git a/question/type/numerical/tests/question_type_test.php b/question/type/numerical/tests/question_type_test.php index 6e64d880efe..e8900900383 100644 --- a/question/type/numerical/tests/question_type_test.php +++ b/question/type/numerical/tests/question_type_test.php @@ -43,11 +43,13 @@ class question_type_test extends \advanced_testcase { protected $qtype; protected function setUp(): void { + parent::setUp(); $this->qtype = new qtype_numerical(); } protected function tearDown(): void { $this->qtype = null; + parent::tearDown(); } protected function get_test_question_data() { diff --git a/question/type/ordering/tests/questionhint_test.php b/question/type/ordering/tests/questionhint_test.php index ed75bbee411..d6c848dc751 100644 --- a/question/type/ordering/tests/questionhint_test.php +++ b/question/type/ordering/tests/questionhint_test.php @@ -40,11 +40,13 @@ final class questionhint_test extends advanced_testcase { protected $qtype; protected function setUp(): void { + parent::setUp(); $this->qtype = new qtype_ordering(); } protected function tearDown(): void { $this->qtype = null; + parent::tearDown(); } /** * Test that hints can be fetched from the DB. diff --git a/question/type/random/tests/question_type_test.php b/question/type/random/tests/question_type_test.php index c99ba338d53..1b34d7a86d0 100644 --- a/question/type/random/tests/question_type_test.php +++ b/question/type/random/tests/question_type_test.php @@ -37,11 +37,13 @@ class question_type_test extends \advanced_testcase { protected $qtype; protected function setUp(): void { + parent::setUp(); $this->qtype = new qtype_random(); } protected function tearDown(): void { $this->qtype = null; + parent::tearDown(); } public function test_name(): void { diff --git a/question/type/shortanswer/tests/question_type_test.php b/question/type/shortanswer/tests/question_type_test.php index 08d49389d69..e68f2c93e1f 100644 --- a/question/type/shortanswer/tests/question_type_test.php +++ b/question/type/shortanswer/tests/question_type_test.php @@ -42,11 +42,13 @@ class question_type_test extends \advanced_testcase { protected $qtype; protected function setUp(): void { + parent::setUp(); $this->qtype = new qtype_shortanswer(); } protected function tearDown(): void { $this->qtype = null; + parent::tearDown(); } protected function get_test_question_data() { diff --git a/question/type/tests/question_first_matching_answer_grading_strategy_test.php b/question/type/tests/question_first_matching_answer_grading_strategy_test.php index 1071f8dd0d7..45115317fa3 100644 --- a/question/type/tests/question_first_matching_answer_grading_strategy_test.php +++ b/question/type/tests/question_first_matching_answer_grading_strategy_test.php @@ -63,9 +63,11 @@ class test_response_answer_comparer implements \question_response_answer_compare */ class question_first_matching_answer_grading_strategy_test extends \advanced_testcase { protected function setUp(): void { + parent::setUp(); } protected function tearDown(): void { + parent::tearDown(); } public function test_no_answers_gives_null(): void { diff --git a/question/type/truefalse/tests/question_type_test.php b/question/type/truefalse/tests/question_type_test.php index e0ec3fdcb66..43e035ddeb8 100644 --- a/question/type/truefalse/tests/question_type_test.php +++ b/question/type/truefalse/tests/question_type_test.php @@ -40,11 +40,13 @@ class question_type_test extends \advanced_testcase { protected $qtype; protected function setUp(): void { + parent::setUp(); $this->qtype = new qtype_truefalse(); } protected function tearDown(): void { $this->qtype = null; + parent::tearDown(); } public function test_name(): void { diff --git a/rating/tests/externallib_test.php b/rating/tests/externallib_test.php index 344f831eedf..86fd3a1077a 100644 --- a/rating/tests/externallib_test.php +++ b/rating/tests/externallib_test.php @@ -90,6 +90,7 @@ class externallib_test extends externallib_advanced_testcase { */ public function setUp(): void { global $DB; + parent::setUp(); $this->resetAfterTest(); $this->course = self::getDataGenerator()->create_course(); diff --git a/report/completion/tests/event/events_test.php b/report/completion/tests/event/events_test.php index 4626027df60..450ab830bc2 100644 --- a/report/completion/tests/event/events_test.php +++ b/report/completion/tests/event/events_test.php @@ -39,6 +39,7 @@ class events_test extends \advanced_testcase { * Setup testcase. */ public function setUp(): void { + parent::setUp(); $this->setAdminUser(); $this->resetAfterTest(); } diff --git a/report/log/tests/event/events_test.php b/report/log/tests/event/events_test.php index b0abfcf8097..7b7aac7e0ba 100644 --- a/report/log/tests/event/events_test.php +++ b/report/log/tests/event/events_test.php @@ -39,6 +39,7 @@ class events_test extends \advanced_testcase { * Setup testcase. */ public function setUp(): void { + parent::setUp(); $this->setAdminUser(); $this->resetAfterTest(); } diff --git a/report/log/tests/lib_test.php b/report/log/tests/lib_test.php index 0e1985c5dc2..b722533db66 100644 --- a/report/log/tests/lib_test.php +++ b/report/log/tests/lib_test.php @@ -52,6 +52,7 @@ class lib_test extends \advanced_testcase { private $tree; public function setUp(): void { + parent::setUp(); $this->user = $this->getDataGenerator()->create_user(); $this->course = $this->getDataGenerator()->create_course(); $this->tree = new \core_user\output\myprofile\tree(); diff --git a/report/log/tests/renderable_test.php b/report/log/tests/renderable_test.php index 8afe9e42813..0b26d247cb7 100644 --- a/report/log/tests/renderable_test.php +++ b/report/log/tests/renderable_test.php @@ -265,6 +265,7 @@ class renderable_test extends \advanced_testcase { * @throws \coding_exception */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); $this->courses[self::COURSE_SEPARATE_GROUP] = $this->getDataGenerator()->create_course(['groupmode' => SEPARATEGROUPS]); $this->courses[self::COURSE_VISIBLE_GROUP] = $this->getDataGenerator()->create_course(['groupmode' => VISIBLEGROUPS]); diff --git a/report/loglive/tests/event/events_test.php b/report/loglive/tests/event/events_test.php index 5a57cb038ca..075df413cb0 100644 --- a/report/loglive/tests/event/events_test.php +++ b/report/loglive/tests/event/events_test.php @@ -39,6 +39,7 @@ class events_test extends \advanced_testcase { * Setup testcase. */ public function setUp(): void { + parent::setUp(); $this->setAdminUser(); $this->resetAfterTest(); } diff --git a/report/loglive/tests/table_log_test.php b/report/loglive/tests/table_log_test.php index 9f5dac1a14e..5c87e2236c2 100644 --- a/report/loglive/tests/table_log_test.php +++ b/report/loglive/tests/table_log_test.php @@ -224,6 +224,7 @@ class table_log_test extends advanced_testcase { */ public function setUp(): void { global $DB; + parent::setUp(); $this->resetAfterTest(); $this->preventResetByRollback(); // This is to ensure that we can actually trigger event and record them in the log store. $this->courses[self::COURSE_SEPARATE_GROUP] = $this->getDataGenerator()->create_course(['groupmode' => SEPARATEGROUPS]); diff --git a/report/outline/tests/lib_test.php b/report/outline/tests/lib_test.php index d88ed6d4efe..b0d4b03a367 100644 --- a/report/outline/tests/lib_test.php +++ b/report/outline/tests/lib_test.php @@ -62,6 +62,7 @@ class lib_test extends \advanced_testcase { private $roleid; public function setUp(): void { + parent::setUp(); $this->user = $this->getDataGenerator()->create_user(); $this->course = $this->getDataGenerator()->create_course(); $this->tree = new \core_user\output\myprofile\tree(); diff --git a/report/questioninstances/tests/event/events_test.php b/report/questioninstances/tests/event/events_test.php index 5fe917bc8b5..932d48f8c61 100644 --- a/report/questioninstances/tests/event/events_test.php +++ b/report/questioninstances/tests/event/events_test.php @@ -37,6 +37,7 @@ class events_test extends \advanced_testcase { * Setup testcase. */ public function setUp(): void { + parent::setUp(); $this->setAdminUser(); $this->resetAfterTest(); } diff --git a/report/stats/tests/event/events_test.php b/report/stats/tests/event/events_test.php index 4c302777029..9b5ade40997 100644 --- a/report/stats/tests/event/events_test.php +++ b/report/stats/tests/event/events_test.php @@ -39,6 +39,7 @@ class events_test extends \advanced_testcase { * Setup testcase. */ public function setUp(): void { + parent::setUp(); $this->setAdminUser(); $this->resetAfterTest(); } diff --git a/report/stats/tests/lib_test.php b/report/stats/tests/lib_test.php index 2624a37f35e..af445031e86 100644 --- a/report/stats/tests/lib_test.php +++ b/report/stats/tests/lib_test.php @@ -50,6 +50,7 @@ class lib_test extends \advanced_testcase { private $tree; public function setUp(): void { + parent::setUp(); $this->user = $this->getDataGenerator()->create_user(); $this->course = $this->getDataGenerator()->create_course(); $this->tree = new \core_user\output\myprofile\tree(); diff --git a/report/usersessions/tests/lib_test.php b/report/usersessions/tests/lib_test.php index d9d2f969eae..9ade30fd2d3 100644 --- a/report/usersessions/tests/lib_test.php +++ b/report/usersessions/tests/lib_test.php @@ -54,6 +54,7 @@ class lib_test extends \advanced_testcase { private $tree; public function setUp(): void { + parent::setUp(); $this->user = $this->getDataGenerator()->create_user(); $this->course = $this->getDataGenerator()->create_course(); $this->tree = new \core_user\output\myprofile\tree(); diff --git a/reportbuilder/tests/external/system_report_exporter_test.php b/reportbuilder/tests/external/system_report_exporter_test.php index 3a2c90e0641..4d73c920304 100644 --- a/reportbuilder/tests/external/system_report_exporter_test.php +++ b/reportbuilder/tests/external/system_report_exporter_test.php @@ -41,6 +41,7 @@ class system_report_exporter_test extends advanced_testcase { global $CFG; require_once("{$CFG->dirroot}/reportbuilder/tests/fixtures/system_report_available.php"); + parent::setUpBeforeClass(); } /** diff --git a/reportbuilder/tests/local/aggregation/groupconcatdistinct_test.php b/reportbuilder/tests/local/aggregation/groupconcatdistinct_test.php index 1753b88beb3..d1245aac9a4 100644 --- a/reportbuilder/tests/local/aggregation/groupconcatdistinct_test.php +++ b/reportbuilder/tests/local/aggregation/groupconcatdistinct_test.php @@ -46,6 +46,7 @@ class groupconcatdistinct_test extends core_reportbuilder_testcase { */ public function setUp(): void { global $DB; + parent::setUp(); if (!groupconcatdistinct::compatible(column::TYPE_TEXT)) { $this->markTestSkipped('Distinct group concatenation not supported in ' . $DB->get_dbfamily()); diff --git a/reportbuilder/tests/local/report/base_test.php b/reportbuilder/tests/local/report/base_test.php index 25c71114834..5f4938c555a 100644 --- a/reportbuilder/tests/local/report/base_test.php +++ b/reportbuilder/tests/local/report/base_test.php @@ -43,6 +43,7 @@ class base_test extends advanced_testcase { public static function setUpBeforeClass(): void { global $CFG; require_once("{$CFG->dirroot}/reportbuilder/tests/fixtures/system_report_available.php"); + parent::setUpBeforeClass(); } /** diff --git a/repository/flickr/tests/privacy/provider_test.php b/repository/flickr/tests/privacy/provider_test.php index ebb4ccbad40..a11cd2658ab 100644 --- a/repository/flickr/tests/privacy/provider_test.php +++ b/repository/flickr/tests/privacy/provider_test.php @@ -41,6 +41,7 @@ class provider_test extends provider_testcase { * Overriding setUp() function to always reset after tests. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); } diff --git a/repository/nextcloud/tests/access_controlled_link_manager_test.php b/repository/nextcloud/tests/access_controlled_link_manager_test.php index 79584fe8ecc..54d58eacefc 100644 --- a/repository/nextcloud/tests/access_controlled_link_manager_test.php +++ b/repository/nextcloud/tests/access_controlled_link_manager_test.php @@ -53,6 +53,7 @@ class access_controlled_link_manager_test extends \advanced_testcase { * SetUp to create an repository instance. */ protected function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); // Admin is necessary to create issuer object. diff --git a/repository/nextcloud/tests/lib_test.php b/repository/nextcloud/tests/lib_test.php index f6ae5ba85e3..a266f875529 100644 --- a/repository/nextcloud/tests/lib_test.php +++ b/repository/nextcloud/tests/lib_test.php @@ -50,6 +50,7 @@ class lib_test extends \advanced_testcase { * SetUp to create an repository instance. */ protected function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); // Admin is neccessary to create api and issuer objects. diff --git a/repository/nextcloud/tests/ocs_test.php b/repository/nextcloud/tests/ocs_test.php index e787852c6e5..37dbf36bc91 100644 --- a/repository/nextcloud/tests/ocs_test.php +++ b/repository/nextcloud/tests/ocs_test.php @@ -35,6 +35,7 @@ class ocs_test extends \advanced_testcase { * SetUp to create issuer and endpoints for OCS testing. */ protected function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); // Admin is neccessary to create issuer object. diff --git a/repository/onedrive/tests/privacy/provider_test.php b/repository/onedrive/tests/privacy/provider_test.php index df11a0f0c8c..bb67a2ab8e8 100644 --- a/repository/onedrive/tests/privacy/provider_test.php +++ b/repository/onedrive/tests/privacy/provider_test.php @@ -41,6 +41,7 @@ class provider_test extends \core_privacy\tests\provider_testcase { * Overriding setUp() function to always reset after tests. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); } diff --git a/repository/recent/tests/lib_test.php b/repository/recent/tests/lib_test.php index 291adbdf5fc..84d642e79d8 100644 --- a/repository/recent/tests/lib_test.php +++ b/repository/recent/tests/lib_test.php @@ -54,6 +54,7 @@ class lib_test extends \advanced_testcase { */ protected function setUp(): void { global $USER; + parent::setUp(); $this->setAdminUser(); $this->usercontext = \context_user::instance($USER->id); $repoid = $this->getDataGenerator()->create_repository('recent')->id; diff --git a/repository/tests/privacy/provider_test.php b/repository/tests/privacy/provider_test.php index 5b71b4aa236..c9665252d92 100644 --- a/repository/tests/privacy/provider_test.php +++ b/repository/tests/privacy/provider_test.php @@ -43,6 +43,7 @@ class provider_test extends \core_privacy\tests\provider_testcase { * Overriding setUp() function to always reset after tests. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); } diff --git a/rss/tests/privacy/provider_test.php b/rss/tests/privacy/provider_test.php index ca8a3612ac9..fe2b8b3ce80 100644 --- a/rss/tests/privacy/provider_test.php +++ b/rss/tests/privacy/provider_test.php @@ -42,6 +42,7 @@ class provider_test extends provider_testcase { * Basic setup for these tests. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); } diff --git a/search/engine/simpledb/tests/engine_test.php b/search/engine/simpledb/tests/engine_test.php index 7fa21c90105..c1d31d101b0 100644 --- a/search/engine/simpledb/tests/engine_test.php +++ b/search/engine/simpledb/tests/engine_test.php @@ -53,6 +53,7 @@ class engine_test extends \advanced_testcase { * @return void */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); if ($this->requires_manual_index_update()) { @@ -86,6 +87,7 @@ class engine_test extends \advanced_testcase { $this->generator->teardown(); $this->generator = null; } + parent::tearDown(); } /** diff --git a/search/engine/simpledb/tests/privacy/provider_test.php b/search/engine/simpledb/tests/privacy/provider_test.php index b78ff9d96dd..43bf707a145 100644 --- a/search/engine/simpledb/tests/privacy/provider_test.php +++ b/search/engine/simpledb/tests/privacy/provider_test.php @@ -71,6 +71,7 @@ class provider_test extends \core_privacy\tests\provider_testcase { public function setUp(): void { global $DB; + parent::setUp(); if ($this->requires_manual_index_update()) { // We need to update fulltext index manually, which requires an alter table statement. diff --git a/search/engine/solr/tests/engine_test.php b/search/engine/solr/tests/engine_test.php index fc3369479ae..ace0527f225 100644 --- a/search/engine/solr/tests/engine_test.php +++ b/search/engine/solr/tests/engine_test.php @@ -64,6 +64,7 @@ class engine_test extends \advanced_testcase { protected $engine = null; public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); set_config('enableglobalsearch', true); set_config('searchengine', 'solr'); @@ -138,6 +139,7 @@ class engine_test extends \advanced_testcase { $this->generator->teardown(); $this->generator = null; } + parent::tearDown(); } /** diff --git a/search/tests/base_activity_test.php b/search/tests/base_activity_test.php index 48f501686fd..0e70978bece 100644 --- a/search/tests/base_activity_test.php +++ b/search/tests/base_activity_test.php @@ -53,6 +53,7 @@ class base_activity_test extends \advanced_testcase { public function setUp(): void { global $DB; + parent::setUp(); $this->resetAfterTest(); set_config('enableglobalsearch', true); @@ -103,6 +104,7 @@ class base_activity_test extends \advanced_testcase { $this->generator->teardown(); $this->generator = null; } + parent::tearDown(); } /** diff --git a/search/tests/base_test.php b/search/tests/base_test.php index 4b93836ded0..e834e2aa90d 100644 --- a/search/tests/base_test.php +++ b/search/tests/base_test.php @@ -46,6 +46,7 @@ class base_test extends \advanced_testcase { protected $engine = null; public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); set_config('enableglobalsearch', true); @@ -63,6 +64,7 @@ class base_test extends \advanced_testcase { $this->generator->teardown(); $this->generator = null; } + parent::tearDown(); } /** diff --git a/search/tests/document_test.php b/search/tests/document_test.php index b35865adaaf..ff91ccae2f4 100644 --- a/search/tests/document_test.php +++ b/search/tests/document_test.php @@ -49,6 +49,7 @@ class document_test extends \advanced_testcase { protected $generator = null; public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); set_config('enableglobalsearch', true); @@ -134,6 +135,7 @@ class document_test extends \advanced_testcase { $this->generator->teardown(); $this->generator = null; } + parent::tearDown(); } /** diff --git a/search/tests/engine_test.php b/search/tests/engine_test.php index 08059b820a9..fbb72d0ee99 100644 --- a/search/tests/engine_test.php +++ b/search/tests/engine_test.php @@ -32,6 +32,7 @@ require_once(__DIR__ . '/fixtures/mock_search_area.php'); class engine_test extends \advanced_testcase { public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); set_config('enableglobalsearch', true); diff --git a/search/tests/external/get_results_test.php b/search/tests/external/get_results_test.php index 414c212e359..6e1a12aafb6 100644 --- a/search/tests/external/get_results_test.php +++ b/search/tests/external/get_results_test.php @@ -35,6 +35,7 @@ require_once($CFG->dirroot . '/webservice/tests/helpers.php'); class get_results_test extends \externallib_advanced_testcase { public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); } diff --git a/search/tests/external/get_search_areas_list_test.php b/search/tests/external/get_search_areas_list_test.php index 8ed8bb7492c..3bf89628b99 100644 --- a/search/tests/external/get_search_areas_list_test.php +++ b/search/tests/external/get_search_areas_list_test.php @@ -35,6 +35,7 @@ require_once($CFG->dirroot . '/webservice/tests/helpers.php'); class get_search_areas_list_test extends \externallib_advanced_testcase { public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); } diff --git a/search/tests/external/get_top_results_test.php b/search/tests/external/get_top_results_test.php index 8e034d2f3c7..4de5b21d5bc 100644 --- a/search/tests/external/get_top_results_test.php +++ b/search/tests/external/get_top_results_test.php @@ -35,6 +35,7 @@ require_once($CFG->dirroot . '/webservice/tests/helpers.php'); class get_top_results_test extends \externallib_advanced_testcase { public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); } diff --git a/search/tests/external/view_results_test.php b/search/tests/external/view_results_test.php index 76ba009833d..634be3bbff8 100644 --- a/search/tests/external/view_results_test.php +++ b/search/tests/external/view_results_test.php @@ -35,6 +35,7 @@ require_once($CFG->dirroot . '/webservice/tests/helpers.php'); class view_results_test extends \externallib_advanced_testcase { public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); } diff --git a/search/tests/external_test.php b/search/tests/external_test.php index b6ca543d78f..32fe39f9846 100644 --- a/search/tests/external_test.php +++ b/search/tests/external_test.php @@ -34,6 +34,7 @@ namespace core_search; class external_test extends \advanced_testcase { public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); } diff --git a/search/tests/manager_test.php b/search/tests/manager_test.php index 4a9939fd7bb..a24cef37161 100644 --- a/search/tests/manager_test.php +++ b/search/tests/manager_test.php @@ -47,6 +47,7 @@ class manager_test extends \advanced_testcase { protected $coursesareaid = null; public function setUp(): void { + parent::setUp(); $this->forumpostareaid = \core_search\manager::generate_areaid('mod_forum', 'post'); $this->coursesareaid = \core_search\manager::generate_areaid('core_course', 'course'); } diff --git a/tag/tests/event/events_test.php b/tag/tests/event/events_test.php index 6a7fe02f836..a0df0d56895 100644 --- a/tag/tests/event/events_test.php +++ b/tag/tests/event/events_test.php @@ -40,6 +40,7 @@ class events_test extends \advanced_testcase { * This is executed before running any test in this file. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); } diff --git a/tag/tests/taglib_test.php b/tag/tests/taglib_test.php index 96206f69bf4..1f9efba5133 100644 --- a/tag/tests/taglib_test.php +++ b/tag/tests/taglib_test.php @@ -36,6 +36,7 @@ class taglib_test extends \advanced_testcase { * This is executed before running any test in this file. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); } diff --git a/user/profile/field/checkbox/tests/privacy/provider_test.php b/user/profile/field/checkbox/tests/privacy/provider_test.php index b8653d2120a..b64c4cb0f05 100644 --- a/user/profile/field/checkbox/tests/privacy/provider_test.php +++ b/user/profile/field/checkbox/tests/privacy/provider_test.php @@ -41,6 +41,7 @@ class provider_test extends provider_testcase { * Basic setup for these tests. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); } diff --git a/user/profile/field/checkbox/tests/profile_field_checkbox_test.php b/user/profile/field/checkbox/tests/profile_field_checkbox_test.php index d008e859519..815c1aa1f85 100644 --- a/user/profile/field/checkbox/tests/profile_field_checkbox_test.php +++ b/user/profile/field/checkbox/tests/profile_field_checkbox_test.php @@ -35,6 +35,7 @@ class profile_field_checkbox_test extends advanced_testcase { public static function setUpBeforeClass(): void { global $CFG; require_once("{$CFG->dirroot}/user/profile/lib.php"); + parent::setUpBeforeClass(); } /** diff --git a/user/profile/field/datetime/tests/privacy/provider_test.php b/user/profile/field/datetime/tests/privacy/provider_test.php index 28d2209db98..bfa98699f8d 100644 --- a/user/profile/field/datetime/tests/privacy/provider_test.php +++ b/user/profile/field/datetime/tests/privacy/provider_test.php @@ -41,6 +41,7 @@ class provider_test extends provider_testcase { * Basic setup for these tests. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); } diff --git a/user/profile/field/menu/tests/privacy/provider_test.php b/user/profile/field/menu/tests/privacy/provider_test.php index 673b2944d2b..b970ec51338 100644 --- a/user/profile/field/menu/tests/privacy/provider_test.php +++ b/user/profile/field/menu/tests/privacy/provider_test.php @@ -41,6 +41,7 @@ class provider_test extends provider_testcase { * Basic setup for these tests. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); } diff --git a/user/profile/field/social/tests/privacy/provider_test.php b/user/profile/field/social/tests/privacy/provider_test.php index 790079af343..cab742c3326 100644 --- a/user/profile/field/social/tests/privacy/provider_test.php +++ b/user/profile/field/social/tests/privacy/provider_test.php @@ -41,6 +41,7 @@ class provider_test extends provider_testcase { * Basic setup for these tests. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); } diff --git a/user/profile/field/text/tests/privacy/provider_test.php b/user/profile/field/text/tests/privacy/provider_test.php index e7ec984728f..a08063a6998 100644 --- a/user/profile/field/text/tests/privacy/provider_test.php +++ b/user/profile/field/text/tests/privacy/provider_test.php @@ -39,6 +39,7 @@ class provider_test extends provider_testcase { * Basic setup for these tests. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); } diff --git a/user/profile/field/textarea/tests/privacy/provider_test.php b/user/profile/field/textarea/tests/privacy/provider_test.php index 54e81178ffc..f84d3eb2836 100644 --- a/user/profile/field/textarea/tests/privacy/provider_test.php +++ b/user/profile/field/textarea/tests/privacy/provider_test.php @@ -41,6 +41,7 @@ class provider_test extends provider_testcase { * Basic setup for these tests. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); } diff --git a/user/tests/profilelib_test.php b/user/tests/profilelib_test.php index 6e91acc7967..3720fae9eff 100644 --- a/user/tests/profilelib_test.php +++ b/user/tests/profilelib_test.php @@ -31,6 +31,7 @@ class profilelib_test extends \advanced_testcase { public static function setUpBeforeClass(): void { global $CFG; require_once("{$CFG->dirroot}/user/profile/lib.php"); + parent::setUpBeforeClass(); } /** diff --git a/user/tests/search/search_test.php b/user/tests/search/search_test.php index 8bbebdcbfdd..1fd56cd5f09 100644 --- a/user/tests/search/search_test.php +++ b/user/tests/search/search_test.php @@ -44,6 +44,7 @@ class search_test extends \advanced_testcase { protected $userareaid = null; public function setUp(): void { + parent::setUp(); $this->resetAfterTest(true); set_config('enableglobalsearch', true); diff --git a/webservice/tests/event/events_test.php b/webservice/tests/event/events_test.php index 899a51d6f7f..6ab23bd70c6 100644 --- a/webservice/tests/event/events_test.php +++ b/webservice/tests/event/events_test.php @@ -36,6 +36,7 @@ namespace core_webservice\event; class events_test extends \advanced_testcase { public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); }