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 5ab04fd041e65..b5daac1123651 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 30d7c842384bf..4866268fffffa 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 4e90f2f932d57..50a14d34e3495 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 6015eba03bf72..5b24b017fb5af 100644 --- a/admin/tool/brickfield/tests/registration_test.php +++ b/admin/tool/brickfield/tests/registration_test.php @@ -34,6 +34,7 @@ public static function setUpBeforeClass(): void { 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 9b0947147d201..01380100010d8 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 04d412e6c636f..9e53a9824e1e6 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 ab7fdfa7a7554..90a5638af0194 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 4fd6aebdd812a..9f760b6cb51dc 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 87e82d103d519..94b8984b6d56c 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 08d20c567a158..d66f5b1259464 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 @@ */ 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 e08d5d32c9123..0fc21788a45de 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 31d9f2bb32825..5c9f084899dec 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 670039668e7e4..323ed7f5c4e03 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 @@ 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 5358143e59cb6..a685f8119a997 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 @@ public function tearDown(): void { 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 0d078ee1c1c2a..d582404fa10c2 100644 --- a/admin/tool/log/tests/privacy/provider_test.php +++ b/admin/tool/log/tests/privacy/provider_test.php @@ -53,6 +53,7 @@ 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 db63e158c319b..0e711113c78c3 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 5d1c427ba7b05..1511c54e6c08a 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 41045357c6550..52fa449623e7b 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 9feca9ad90839..75cd49394b448 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 62c63cd92dd64..06bc272e07031 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 92add10ad657f..e11d3df51e72b 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 8fc0c503d1448..4ecf6e7296c1b 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 323d842854ad9..081b966ed1582 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 d17694b1d40b3..71b0a14a1a44e 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 5d75717a3dcfb..c31d3d908fdd2 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 f29f2d9b886da..326cf4c853771 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 53e5e17188b42..6efc076930c17 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 85d252e83f9c6..b4532f875fb27 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 94c8c3c48bb58..31db2f469fc61 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 b7b029ab9bb8f..4fa496b56bb36 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 3b70138f9c228..3093e06c83fa2 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 b12aa4de0d3c2..73b024f809f18 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 95de24e3f5c50..8a1de0dc42745 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 7cdcf42053dbc..a1681ac3fc383 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 565b1d6ed42ce..82b19f6d7fa4b 100644 --- a/admin/tool/uploaduser/tests/upload_users_test.php +++ b/admin/tool/uploaduser/tests/upload_users_test.php @@ -40,6 +40,7 @@ public static function setUpBeforeClass(): void { 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 1458ee14763c0..31c9c7b1406f6 100644 --- a/admin/tool/usertours/tests/accessdate_filter_test.php +++ b/admin/tool/usertours/tests/accessdate_filter_test.php @@ -28,6 +28,7 @@ */ 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 924ba268e85fe..3448f42713db5 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 @@ public function tearDown(): void { 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 ceff72fb39ba2..7e0a900b85c25 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 8ba2cafa2faf5..530605ecb3523 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 @@ public function tearDown(): void { 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 e32df99a1f815..54d0165fa0441 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 @@ public static function setUpBeforeClass(): void { */ public function setUp(): void { global $DB; + parent::setUp(); $this->db = $DB; } @@ -51,6 +53,7 @@ public function tearDown(): void { global $DB; $DB = $this->db; + parent::tearDown(); } /** diff --git a/analytics/tests/course_test.php b/analytics/tests/course_test.php index bff564b4ead3c..621a5377a659b 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 ab7c28a9681d2..6f16102920c95 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 b2a621379a0bc..b02b97485f873 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 005595923a926..5fd157a5e2688 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 08aa1c0f3007b..f24952185b86d 100644 --- a/analytics/tests/prediction_test.php +++ b/analytics/tests/prediction_test.php @@ -63,6 +63,7 @@ public function tearDown(): void { 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 06ed516d99c3f..ca371987d7bde 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 5d8f3019c5c61..7c8eb2390cdc7 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 cd5026c08fe2e..57fc1ee587e57 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 0e98f0867140f..147d932ca3a7f 100644 --- a/auth/db/tests/db_test.php +++ b/auth/db/tests/db_test.php @@ -41,6 +41,7 @@ public static function tearDownAfterClass(): void { 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 bb51a77e34b74..a29b8f77eb12f 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 d58146f946326..0f3faa4368b0f 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 77503b18e8781..959ca6f3fbc52 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 178f367336805..52741ee0412a4 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 a41ac4de0f8c4..046b764858ac7 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 d398182fac054..67ffd9799d6ad 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 07a47aa39c6a7..281a9a4fb9083 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 469acfe6ba9b5..70e308d10a3a4 100644 --- a/auth/tests/privacy/provider_test.php +++ b/auth/tests/privacy/provider_test.php @@ -45,6 +45,7 @@ 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 d76857fdf310b..1158b98726988 100644 --- a/availability/condition/completion/tests/condition_test.php +++ b/availability/condition/completion/tests/condition_test.php @@ -45,6 +45,7 @@ public static function setupBeforeClass(): void { * 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 e34f6681feb07..ec03011f88361 100644 --- a/availability/condition/date/tests/condition_test.php +++ b/availability/condition/date/tests/condition_test.php @@ -33,6 +33,7 @@ public function setUp(): void { // 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 f20a3d9a554bf..ba745e2b7a078 100644 --- a/availability/condition/group/tests/condition_test.php +++ b/availability/condition/group/tests/condition_test.php @@ -31,6 +31,7 @@ public function setUp(): void { // 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 0de2be5aa288e..e00b5a12bc95a 100644 --- a/availability/condition/grouping/tests/condition_test.php +++ b/availability/condition/grouping/tests/condition_test.php @@ -31,6 +31,7 @@ public function setUp(): void { // 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 e8a61f4bb8cfb..673ed6f6c9208 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 0e8d01fd5b6d1..739fd9883aefe 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 3720e816f3421..3f2e4f4e6ac9d 100644 --- a/availability/tests/tree_test.php +++ b/availability/tests/tree_test.php @@ -28,6 +28,7 @@ public function setUp(): void { // 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 f2ade3d613674..db9b0dd488f7d 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 b11f5058d1196..b771d1e6c9959 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 @@ protected function tearDown(): void { if (empty($CFG->keeptempdirectoriesonbackup)) { fulldelete($this->tempdirpath); } + parent::tearDown(); } public function test_detect_format() { diff --git a/backup/moodle2/tests/backup_encrypted_content_test.php b/backup/moodle2/tests/backup_encrypted_content_test.php index 5323b93cecf7a..7e9474a21c10f 100644 --- a/backup/moodle2/tests/backup_encrypted_content_test.php +++ b/backup/moodle2/tests/backup_encrypted_content_test.php @@ -37,6 +37,7 @@ 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 fe55452f00ba7..889509ff43974 100644 --- a/backup/moodle2/tests/backup_stepslib_test.php +++ b/backup/moodle2/tests/backup_stepslib_test.php @@ -37,6 +37,7 @@ public static function setUpBeforeClass(): void { 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 3ffcbe6ae584d..6a8eb5e162fa9 100644 --- a/backup/moodle2/tests/restore_stepslib_test.php +++ b/backup/moodle2/tests/restore_stepslib_test.php @@ -34,6 +34,7 @@ public static function setUpBeforeClass(): void { 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 42fdd102374b1..1f7f949e1fa5a 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 0a10bd65ccd3d..6e8ce673b8f6f 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 fed9e12675586..fc19873ba6535 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 7694343658b86..e4ebab5a8ec59 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 a5268d839da97..c9e6b36171d7e 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 6bbd8c739ec78..5047cc1303a7b 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 128a6fd8dac9f..6fe5f30214150 100644 --- a/badges/tests/privacy/provider_test.php +++ b/badges/tests/privacy/provider_test.php @@ -50,6 +50,7 @@ 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 8388fd31e95f1..d541b4e3e2286 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() { diff --git a/blocks/badges/tests/badges_test.php b/blocks/badges/tests/badges_test.php index 2bd60e552f3fe..64cc50e1c93dd 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 be1d28e840e31..6791ffa1e0086 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 6b69e6156bfb1..e857c5b5e3e19 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 6244e7def8093..c348639223d0d 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 e19eb26e23df6..1bdc94c5384ed 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 980d497b37115..b0fa0efead9c6 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 f68574c456ff4..ab75e91141e7a 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 deb92674091eb..07e3ebff39ba4 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 29e438824aaa6..43950b3019b85 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 08b07821ceb51..50ef730b8f2a7 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 d93d91c052143..72fdfee20e71a 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 a15a2ec8d35a4..1baffbd2ac0bb 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 2f653ca62a511..2c6e8ee9756d9 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 774cb86d97207..17eb7642fec37 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 e04f0b4fd3a78..94bfe308a48b9 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 4c69a5870c2f8..cc95d99ca111c 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 6438ccc081c09..6e2391f55850f 100644 --- a/blocks/tests/privacy/provider_test.php +++ b/blocks/tests/privacy/provider_test.php @@ -46,6 +46,7 @@ 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 a2fe8eb0de0c4..a1fe4c750dd9e 100644 --- a/blog/tests/privacy/provider_test.php +++ b/blog/tests/privacy/provider_test.php @@ -49,6 +49,7 @@ 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 604b122bea514..05013afb7941c 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 @@ public function create_store(?string $seed = null): cachestore_redis { * 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 a080816856c39..0a82139c6157f 100644 --- a/cache/tests/cache_test.php +++ b/cache/tests/cache_test.php @@ -63,6 +63,7 @@ public static function setUpBeforeClass(): void { 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 57d5038a2f8b6..c0a3352e396f4 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 b833859538b42..c341f35ce0aa6 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 b7019305f25e7..93835f114c042 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 91ed2a3ff48c0..7d32fd0f2474c 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 737ec32eada42..bd77e9601aea6 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 f212cdff9e924..44de106f7e1ec 100644 --- a/calendar/tests/lib_test.php +++ b/calendar/tests/lib_test.php @@ -32,12 +32,14 @@ public static function setUpBeforeClass(): void { 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 0d3e7d1184eb0..a04290decff10 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 12f8ac248cf9f..e999b8316035c 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 12b625a27a83d..400a14a9cbab3 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 9658a6098faae..e9c50c82a0c7b 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 ffcd5a13f5d47..3b41d323be7a4 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 7f1fc5a8b0f90..ca657ada94fdf 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 4ac3746dc2ffc..59291b70e78b0 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 4e49cf29a564f..129c238c11d89 100644 --- a/comment/tests/privacy/provider_test.php +++ b/comment/tests/privacy/provider_test.php @@ -42,6 +42,7 @@ 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 d4296d0d3b8c5..15b908d474e7b 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 982ba040814ea..72fdd5259e73f 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 8ec02a78e05d6..5bf3262a90a02 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 5a92d85e59d11..96433e1502321 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 7061d7e86e786..4fbdb38d98fa8 100644 --- a/completion/tests/completion_criteria_test.php +++ b/completion/tests/completion_criteria_test.php @@ -36,6 +36,7 @@ public function setUp(): void { 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 51a6b57667892..df5dc08a11803 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 a01e55187097d..3fd456a24e451 100644 --- a/course/format/tests/external/get_state_test.php +++ b/course/format/tests/external/get_state_test.php @@ -55,6 +55,7 @@ public static function setupBeforeClass(): void { * Setup testcase. */ public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); $this->sections = []; @@ -67,6 +68,7 @@ public function setUp(): void { 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 ec0b4e772961f..f949099fb1151 100644 --- a/course/format/tests/formatactions_test.php +++ b/course/format/tests/formatactions_test.php @@ -35,6 +35,7 @@ public static function setUpBeforeClass(): void { 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 19d05e14332d7..63a748d8249a6 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 53057795240e3..e84a2de12d0f5 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 5c6cee521438d..8f663348cf19b 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 e3932342c0e5b..1094b6d46f8d7 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 4ab42703a6352..84e384abab057 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/category_hooks_test.php b/course/tests/category_hooks_test.php index b68de7a7eebe9..bafa4f157f1aa 100644 --- a/course/tests/category_hooks_test.php +++ b/course/tests/category_hooks_test.php @@ -39,6 +39,7 @@ 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 a03babf7a4f90..2a10823a23b6a 100644 --- a/course/tests/courselib_test.php +++ b/course/tests/courselib_test.php @@ -74,6 +74,7 @@ public static function setUpBeforeClass(): void { 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 49dd6ebc038bc..b5e2521198846 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 167204aec4701..1e132e689e057 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 a183b06e5d2d9..6b68aab142cd0 100644 --- a/course/tests/reportbuilder/datasource/participants_test.php +++ b/course/tests/reportbuilder/datasource/participants_test.php @@ -53,6 +53,7 @@ public static function setUpBeforeClass(): void { 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 7498ad1a7fd8b..3fe8e56531457 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 5453eded90007..f5f377e1313fc 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 8b15fb8825d9a..e8ad7a34a8a5e 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 77fdf2950af79..a7590ef170e89 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 837c23da7b6b5..f4243d849599f 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 d24e24ec344e6..5a9b926089ce9 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 d9f1b439fabf6..53b61e2bb53e8 100644 --- a/enrol/database/tests/lib_test.php +++ b/enrol/database/tests/lib_test.php @@ -46,6 +46,7 @@ public static function tearDownAfterClass(): void { 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 061c29b8d7194..d7e44fe24209d 100644 --- a/enrol/database/tests/sync_test.php +++ b/enrol/database/tests/sync_test.php @@ -44,6 +44,7 @@ public static function tearDownAfterClass(): void { 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 c574c37f43c87..f6e7fd4e8e171 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 e0056a89c4e61..5e641c7d1bc4f 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 4c41962822d21..40e5ec62f271d 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 d2e812fecd4e6..03a264f4f58bb 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 a3553183415c2..43cf672c71059 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 9698d5e818b49..6abff3319cd10 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 6900408a513b2..8119c79e8a24d 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 1d832501cb856..f09587ddbdd15 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 fc086ef4f2f25..33b60bfa01d20 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 50073da97a285..33d0b3f5d5ea3 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 4481718ab7cd6..e5e3cb8cc4cfe 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 5f3a35a5f83fe..b32087c228c78 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 75bfa8cb0e8c0..ed07b1befba23 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 70c4bf36c7b0c..f3ebfeacef913 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 9ad70aa34ac83..92abc21ad10e5 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 a6b3092a25589..0311acbcbc188 100644 --- a/favourites/tests/component_favourite_service_test.php +++ b/favourites/tests/component_favourite_service_test.php @@ -29,6 +29,7 @@ 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 6e8583b4e063e..04a9d0446178a 100644 --- a/favourites/tests/privacy/provider_test.php +++ b/favourites/tests/privacy/provider_test.php @@ -39,6 +39,7 @@ 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 d949822eadfc2..0f7844a80962f 100644 --- a/favourites/tests/repository_test.php +++ b/favourites/tests/repository_test.php @@ -30,6 +30,7 @@ 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 3743a6583c9a1..0b92cc137e220 100644 --- a/favourites/tests/user_favourite_service_test.php +++ b/favourites/tests/user_favourite_service_test.php @@ -29,6 +29,7 @@ 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 87e2dbd66bba3..81a0107f59fec 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 c3c222d90fc68..2e4065dc14656 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 75921b7195ac3..48dfc57e1433d 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 d2b94bd04b971..5552b8e8d0358 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 20188b8f421d5..4b45621af25b1 100644 --- a/grade/import/csv/tests/load_data_test.php +++ b/grade/import/csv/tests/load_data_test.php @@ -59,6 +59,7 @@ class load_data_test extends \grade_base_testcase { 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 1557d1c8e7928..8b3610fe69a45 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 47e9d43e181d6..069662680cc7a 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 0b1be6cea1eff..56e2126ed169a 100644 --- a/grade/report/overview/tests/lib_test.php +++ b/grade/report/overview/tests/lib_test.php @@ -33,6 +33,7 @@ protected function setUp(): void { 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 59bb6dc5fe6cd..5f0fd23b63ca9 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 58ac0271b85fc..fb4c3f5d5a93c 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 b1136f70d2da1..d2313215069e9 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 83d6bd8915fd7..46d3b750e01f8 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 49b09c061c8c2..d3439522c0514 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 27c3ea8a28001..7679924b2d008 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 11b3f9b978070..44d53f723ccdf 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 152d2ccfa7d45..8de0b3588ec9c 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 185a3624bcae6..57e33937a63f8 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 66be51cd03079..f2d82e5a95b75 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 b547c186ff1e6..ba95006ac8504 100644 --- a/iplookup/tests/geoip_test.php +++ b/iplookup/tests/geoip_test.php @@ -34,6 +34,7 @@ */ 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 08167e3449736..ffb70961d0112 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 a2dcb20e2983e..9533c7157d944 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 @@ protected function setUp(): void { protected function tearDown(): void { @unlink($this->tempfile); + parent::tearDown(); } public function test_scan_file_not_exists() { diff --git a/lib/dml/tests/pgsql_native_moodle_database_test.php b/lib/dml/tests/pgsql_native_moodle_database_test.php index 09e6030391dc4..476d9eae76a3d 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 da184f77c2b3d..fd3293a874ebf 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 282b8dcb0517d..1bd4e766c045c 100644 --- a/lib/external/tests/privacy/provider_test.php +++ b/lib/external/tests/privacy/provider_test.php @@ -43,6 +43,7 @@ */ 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 218a46b29127d..f1283d5d127be 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 @@ public function tearDown(): void { $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 9480fd6eb8344..e78af6ebb84fc 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 69d5bca3462ea..16aded7df5fe7 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 @@ public function setUp(): void { 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 edd1d8d1075f2..3352b36df8bd2 100644 --- a/lib/filestorage/tests/file_system_test.php +++ b/lib/filestorage/tests/file_system_test.php @@ -38,11 +38,13 @@ 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 818bbe51bda17..acc98562355a6 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() { diff --git a/lib/tests/antivirus_test.php b/lib/tests/antivirus_test.php index 9367fd1f2d4de..257871e21a05e 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 @@ protected function get_check_api_antivirus_status_result() { protected function tearDown(): void { @unlink($this->tempfile); + parent::tearDown(); } public function test_manager_get_antivirus() { diff --git a/lib/tests/attribute_helper_test.php b/lib/tests/attribute_helper_test.php index f8c4af8007ded..4a7a919de3b10 100644 --- a/lib/tests/attribute_helper_test.php +++ b/lib/tests/attribute_helper_test.php @@ -28,6 +28,7 @@ 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 0b5629435110b..4fc203e2be841 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 fefaf4c362986..dcc0c1c2acb28 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 61c92718786cb..d3e8eadb4cb62 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 cc2673da217c4..fb9fa284ce8dc 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 1bf9e49c3dfba..13621999fbe80 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 f989d285ec809..429644e53c171 100644 --- a/lib/tests/db/upgradelib_test.php +++ b/lib/tests/db/upgradelib_test.php @@ -36,6 +36,7 @@ public function setUp(): void { 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 f106159bd30f5..54d2355d2c089 100644 --- a/lib/tests/encryption_test.php +++ b/lib/tests/encryption_test.php @@ -43,9 +43,11 @@ protected function tearDown(): void { } 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 b83e6c5337e97..d887a0cdff56b 100644 --- a/lib/tests/event/contentbank_content_created_test.php +++ b/lib/tests/event/contentbank_content_created_test.php @@ -44,6 +44,7 @@ public static function setUpBeforeClass(): void { 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 8e9191b131a78..d97d92bc452dd 100644 --- a/lib/tests/event/contentbank_content_deleted_test.php +++ b/lib/tests/event/contentbank_content_deleted_test.php @@ -44,6 +44,7 @@ public static function setUpBeforeClass(): void { 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 9292785824bbd..06ef472fd2a7c 100644 --- a/lib/tests/event/contentbank_content_updated_test.php +++ b/lib/tests/event/contentbank_content_updated_test.php @@ -44,6 +44,7 @@ public static function setUpBeforeClass(): void { 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 2aa131f1327ab..efa2da0e30e1c 100644 --- a/lib/tests/event/contentbank_content_uploaded_test.php +++ b/lib/tests/event/contentbank_content_uploaded_test.php @@ -46,6 +46,7 @@ public static function setUpBeforeClass(): void { 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 191cdb45c183d..fa038bb6a60cf 100644 --- a/lib/tests/event/contentbank_content_viewed_test.php +++ b/lib/tests/event/contentbank_content_viewed_test.php @@ -44,6 +44,7 @@ public static function setUpBeforeClass(): void { 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 e385981ac078b..c5d9c47a523d5 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 4af047037914e..bc34cdf995296 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 6c36d7bbcde65..f97fe259ad94d 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 44d6cf8ef2822..b446528687a97 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 f0401f974e10b..c662e9aa4f0a1 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 39ec94b9a5381..225bb93491766 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 2f28e1ac58dff..10a7bdde2fe49 100644 --- a/lib/tests/modinfolib_test.php +++ b/lib/tests/modinfolib_test.php @@ -44,6 +44,7 @@ public static function setUpBeforeClass(): void { 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() { diff --git a/lib/tests/myprofilelib_test.php b/lib/tests/myprofilelib_test.php index fd7344f484bd2..a8bc5e9814270 100644 --- a/lib/tests/myprofilelib_test.php +++ b/lib/tests/myprofilelib_test.php @@ -47,6 +47,7 @@ class myprofilelib_test extends \advanced_testcase { 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 b542762f6872c..6e031b5b471ff 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 b7f9f82d93042..22b246a09bae1 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 c08b3691ed084..8a0a80156eb84 100644 --- a/lib/tests/persistent_test.php +++ b/lib/tests/persistent_test.php @@ -33,6 +33,7 @@ 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 ac74346fc2c4b..7c9a8d11fe490 100644 --- a/lib/tests/plugin_manager_test.php +++ b/lib/tests/plugin_manager_test.php @@ -34,12 +34,14 @@ public static function setUpBeforeClass(): void { 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 6a04b96aec68f..9b774ce1e0de7 100644 --- a/lib/tests/plugininfo/base_test.php +++ b/lib/tests/plugininfo/base_test.php @@ -38,6 +38,7 @@ public static function setUpBeforeClass(): void { 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 @@ 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(); } /** diff --git a/lib/tests/questionlib_test.php b/lib/tests/questionlib_test.php index 2b9415b704d7b..5cb146ba5fad5 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 3585601018e37..8a0d723e463df 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 826160d0cfed6..4d71e9fd3b5ab 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 1628f34e8423c..9093e60620055 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.'); @@ -107,6 +108,7 @@ public function tearDown(): void { $this->redis->del($keyname); } $this->redis->close(); + parent::tearDown(); } public function test_normal_session_read_only() { diff --git a/lib/tests/task/calendar_cron_task_test.php b/lib/tests/task/calendar_cron_task_test.php index 2dbc52c905449..a5a4690d480d7 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 661718f056aff..f5f3acea03e24 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 @@ public function tearDown(): void { $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 9a7b056a765af..b1ca2d6ec6ea3 100644 --- a/lib/tests/task/logging_test.php +++ b/lib/tests/task/logging_test.php @@ -56,6 +56,7 @@ public function tearDown(): void { $DB = $this->DB; $this->DB = null; } + parent::tearDown(); } /** diff --git a/lib/tests/task/manager_test.php b/lib/tests/task/manager_test.php index 5156a33b52db3..c6fd3f3647c18 100644 --- a/lib/tests/task/manager_test.php +++ b/lib/tests/task/manager_test.php @@ -28,6 +28,7 @@ final class manager_test extends \advanced_testcase { public static function setUpBeforeClass(): void { require_once(__DIR__ . '/../fixtures/task_fixtures.php'); + parent::setUpBeforeClass(); } /** diff --git a/lib/tests/task/running_test.php b/lib/tests/task/running_test.php index 6e8eacf330ae5..4bc65a1009376 100644 --- a/lib/tests/task/running_test.php +++ b/lib/tests/task/running_test.php @@ -27,6 +27,7 @@ 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 29b6de77eeac1..a58d3f1be3b41 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 308fafd29248b..c4ff99c5d7bd2 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 43fd556fda690..ea01d8d61b388 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 4b98d8c331727..ce214111158e3 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 dd6848f55a06f..ccecc7b703bc8 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 a99cfcd317f2b..9d5c97d0a5572 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 3dad00aa3be18..95e5c890a16ca 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 f29e15dbbbea7..40677b5220850 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 a98bfeb0ab90e..f7a38316e8515 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 208a7ccc0b389..72ad934589396 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 a8642b90fa698..6c244a25dee1c 100644 --- a/lib/xapi/tests/external/post_statement_test.php +++ b/lib/xapi/tests/external/post_statement_test.php @@ -66,6 +66,7 @@ public static function setupBeforeClass(): void { */ 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 c5d84c7452137..9552d27e17e56 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 c83d698e95f1e..cbb6533e2d2a5 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 fd50f29077f31..eddaa3918faa8 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 40f9653146e61..9f62a562d3947 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 406cacb6260b0..b0b8ead6d56dd 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 87b638e71d877..a1eb82906261c 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 e7c0e6c9f88f1..89bb774d18601 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 b94f1dd43d1c4..fc22030888e59 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 a5e3988d7a2b4..51d21d16de874 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 b5c4b9e0ab02f..feb798906d9b7 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 02538447d3afc..789ceb74becbe 100644 --- a/message/tests/externallib_test.php +++ b/message/tests/externallib_test.php @@ -45,6 +45,7 @@ protected function setUp(): void { 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 6d08f834c88ba..3ede37c7951f8 100644 --- a/message/tests/helper_test.php +++ b/message/tests/helper_test.php @@ -34,6 +34,7 @@ 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 1fe6ed972e321..c5b82bc9e283f 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 fd144fa8e2198..e538406981459 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 c2fbaf7f92c2c..13462ebf7891d 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 d81500499f24e..754445d72c89c 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 15b19de8fc44c..4ac8e168a928b 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 55b9239eacb7f..62d01935f243d 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 3347df22a4bf6..e8e4b21857991 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 71a2a8550dee7..708fa296f47a8 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 a342441468af3..7dccdf5692f9d 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 @@ public function setUp(): void { */ 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 3e3dfaa0ebea8..53a48323e8a1d 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 b51861b9373f4..2dde76b31a4b7 100644 --- a/mod/book/tests/event/events_test.php +++ b/mod/book/tests/event/events_test.php @@ -36,6 +36,7 @@ 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 2493ce156e106..74ac498a8bf3b 100644 --- a/mod/book/tests/lib_test.php +++ b/mod/book/tests/lib_test.php @@ -42,6 +42,7 @@ 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 80dc588499996..25ec44dbf81b6 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 6aabcb433ffed..11c2c2f3ac46f 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 @@ 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 c5b73ef7747a0..187fdd9b1bc72 100644 --- a/mod/book/tool/importhtml/tests/locallib_test.php +++ b/mod/book/tool/importhtml/tests/locallib_test.php @@ -40,6 +40,7 @@ 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 254073c527683..52959cd5e48d9 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 @@ 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 4b3a4d865f4ed..a901e90116542 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 242d35680294d..6fe3982926403 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 0bff12616c786..7f767dddfa1d8 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 c600a61c6a4fa..de6d14b82fccc 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 865c6486d6590..55f5f2c12f1ce 100644 --- a/mod/chat/tests/lib_test.php +++ b/mod/chat/tests/lib_test.php @@ -37,6 +37,7 @@ 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 1adb112b4cfc1..8e5fa016c3e08 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 60807ede129b2..0e12feecd2904 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 6a27b7c27b981..26ef4645e9c73 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 aa7b8207da5f1..ccb5144a93b80 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 9e0cefd55943a..7ad0bcf3e3b62 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 be5b534e51d39..c4f6a4c25e740 100644 --- a/mod/data/tests/lib_test.php +++ b/mod/data/tests/lib_test.php @@ -55,6 +55,7 @@ public function tearDown(): void { $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 5a7a4d530aab0..03fd757d2cf07 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 6123a9099dd55..6f16242871ce7 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 018a887709bd5..b90522eaf7bdf 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 de34617e633ee..399d65f56b2f0 100644 --- a/mod/feedback/tests/privacy/provider_test.php +++ b/mod/feedback/tests/privacy/provider_test.php @@ -49,6 +49,7 @@ 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 35e39a25845e1..f80b457e140f0 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 15825f7388dc9..f91ba30eeae7a 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 @@ public function setUp(): void { 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 c41038aa17cab..3111d3ce0626b 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 f321617cea987..5d32204fab443 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 @@ public function tearDown(): void { // 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 1d0a9c585e21b..275f5a7c42037 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 @@ public function tearDown(): void { // 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 68715c79c1351..a431053757997 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 @@ public function tearDown(): void { // 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 8a1df829d4317..d5e7fd6b30426 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 @@ public function tearDown(): void { // 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 daf9c01009d21..94183e6acaa3c 100644 --- a/mod/forum/tests/generator_test.php +++ b/mod/forum/tests/generator_test.php @@ -27,6 +27,7 @@ */ 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 @@ public function tearDown(): void { // 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 a317305666998..13446c50730fa 100644 --- a/mod/forum/tests/lib_test.php +++ b/mod/forum/tests/lib_test.php @@ -35,6 +35,7 @@ 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 @@ public function tearDown(): void { // 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() { diff --git a/mod/forum/tests/mail_group_test.php b/mod/forum/tests/mail_group_test.php index e32dd2ea67296..b2ed76da53475 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 @@ public function tearDown(): void { $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 ed7af4e5e5ff1..db2d8bbda37df 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 @@ public function tearDown(): void { $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 d4981370e7839..61b3867084ac8 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 @@ public function tearDown(): void { $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 5456c2ce65704..e82ace1ed8129 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 @@ public function tearDown(): void { // 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 f60af987559e2..77392bc853824 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 a09b788cc1af4..8ca5cb4383250 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 @@ public function tearDown(): void { // 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 16d85805ed376..96aeb7960e5fb 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 @@ public function tearDown(): void { $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 7d26221f42e86..a9ef89295cb61 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 6fcb5ee4eb0d4..d674dc4dd046e 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 @@ public function tearDown(): void { // 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 22b822b18c013..2162adbee5e4f 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 cf9824943366d..a70c457dc3b8d 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 ab7f7f9abf745..d5195ba25a7bd 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 @@ public function setUp(): void { */ 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 87b262c013e67..0f04d70a1f526 100644 --- a/mod/glossary/tests/event/events_test.php +++ b/mod/glossary/tests/event/events_test.php @@ -36,6 +36,7 @@ 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 9acb2ee7bb254..8cac127991d33 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 4601d2c3d1b78..312b8911785c6 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 b192abedacae9..1929939eb9e14 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 fcaa807a88533..319a79ef4a0f9 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 f6c5afd894689..b030f24919ff5 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 24bfc74cc5944..d575f0f061d38 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 056491c76c815..0722547fb6e90 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 9a94eae75264e..0da431b081736 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/privacy/provider_test.php b/mod/lti/service/gradebookservices/tests/privacy/provider_test.php index 398aeb71d9f0e..ac14c0dbd734e 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 16564b40325c1..1b1eac5b583a1 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 3f8ae108bbdd7..7b6ca07830df7 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 b6c408ffa24a5..2ba2af5c52afb 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 a482db767e8a6..78fa9d6474aaa 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 4cee9bb25a201..1a0d4fbcd3ba3 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 d817301776988..93ab2641c570a 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 ccc1a08c1a0cc..45ef20b9b693d 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 96712c0d23221..4bcc06b729c83 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 6da48695a3f3b..54a2fc580ca09 100644 --- a/mod/quiz/accessrule/seb/tests/rule_test.php +++ b/mod/quiz/accessrule/seb/tests/rule_test.php @@ -53,6 +53,7 @@ public function tearDown(): void { 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 8e32faee8b2cd..b24c71bd1d673 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 @@ public function tearDown(): void { 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 0f871ee658d6d..6d8c7a27aad96 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 0ff60cbc727f9..a26318d323623 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 @@ -77,6 +77,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 17fd9e3ad5527..3bbaf987e4606 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 5fd21c18c9b07..5fcdad010313c 100644 --- a/mod/quiz/tests/restore_attempt_test.php +++ b/mod/quiz/tests/restore_attempt_test.php @@ -37,6 +37,7 @@ public static function setUpBeforeClass(): void { 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 a60e695c6a0d6..0835b7d1d123f 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 bb0945a02217b..8d2fa5550d93b 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 7bbd6cf29dc71..910d3a6ee4d68 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 8d7818495706b..33a4fc546d4b1 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 c87dbcb45f49c..b5b1246b26454 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 5f9c4ed9c0eb2..c8c3b2227a690 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 deafc58c07c95..e9112666aaa94 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 f6ef94c501a43..cc04f89f29555 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 92453b73a37b7..a703135b48ff2 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 6f7093a50c4f9..bad1bc64220d5 100644 --- a/mod/scorm/tests/locallib_test.php +++ b/mod/scorm/tests/locallib_test.php @@ -41,6 +41,7 @@ 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 62c2023e2a6e3..af068b4ae0277 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 3684d39a70972..abc238bc02457 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 da5f641407b4f..04af6dd16c574 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 69038d2eab229..1b3f54a66feee 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 56e7860d5cdd8..55b330cfe14e6 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 5b8cd77dc87dd..c207ab77e9223 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 f23e121b2e154..2cd2811b23b95 100644 --- a/mod/url/tests/lib_test.php +++ b/mod/url/tests/lib_test.php @@ -45,6 +45,7 @@ public static function setUpBeforeClass(): void { 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 e1363b6722d31..eae710511d3a4 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 7a5dd1cea4d51..efe68c46e451b 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 be61e2e21b61c..5f70f8f842db8 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 29d97934c0445..44821fa51131d 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 8b1d0b80fe902..f1820c4674911 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 7f167b29a7d79..5dc3902f3cb49 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 3b7c486a6f45c..35b474f4db0f8 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 0e8fca669626d..c60b525a4801d 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 c449a3630bb25..600b139268c04 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 b0b5296e61648..812c87a584bb4 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 9ddf227fd901f..8c64498d90b3e 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 f749609a31948..89db7091175a6 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 47960afd270d3..f0fe0c8e21e1f 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 16007badad3fc..13a9df986fbfd 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 c80e4939a631c..7568d2f7d348a 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 d68d65cae3277..8e8ec1f5ded22 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 dbb4d509d134b..3ce6ba8bd9387 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 0d31bc2e0f77e..880fc657a31de 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 10b81ecaedb21..ca343edfc617a 100644 --- a/question/engine/tests/question_engine_test.php +++ b/question/engine/tests/question_engine_test.php @@ -45,6 +45,7 @@ public static function setUpBeforeClass(): void { 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 fe1397fec54be..3c9509b307810 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 8ddfb7a518155..efbcda9593269 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 @@ protected function setUp(): void { protected function tearDown(): void { $this->qa = null; + parent::tearDown(); } public function test_get_step_before_start() { diff --git a/question/engine/tests/questionattemptiterator_test.php b/question/engine/tests/questionattemptiterator_test.php index d979be8001335..2b26d5da52562 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 @@ protected function setUp(): void { protected function tearDown(): void { $this->quba = null; $this->iterator = null; + parent::tearDown(); } public function test_foreach_loop() { diff --git a/question/engine/tests/questionattemptstepiterator_test.php b/question/engine/tests/questionattemptstepiterator_test.php index 8ebacfa30acd7..5cd15e9f1abe8 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 @@ protected function setUp(): void { protected function tearDown(): void { $this->qa = null; $this->iterator = null; + parent::tearDown(); } public function test_foreach_loop() { diff --git a/question/engine/tests/questionusage_autosave_test.php b/question/engine/tests/questionusage_autosave_test.php index 660744cbd6314..1dd8dc6a482c6 100644 --- a/question/engine/tests/questionusage_autosave_test.php +++ b/question/engine/tests/questionusage_autosave_test.php @@ -747,5 +747,6 @@ protected function tearDown(): void { // 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 021e1389c8059..7d5935c0882b0 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 @@ protected function setUp(): void { 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 9e99976791c3c..5024d56038dd2 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 c34ddc2d85760..0d3c8193dcaf9 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 d1504b535d79e..dbb17b74af6ab 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() { diff --git a/question/type/calculatedsimple/tests/question_type_test.php b/question/type/calculatedsimple/tests/question_type_test.php index aef8180b1fee5..5c678d5ea51f3 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() { diff --git a/question/type/ddimageortext/tests/question_type_test.php b/question/type/ddimageortext/tests/question_type_test.php index 8b39c2673eda2..da595b63f75f8 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() { diff --git a/question/type/ddmarker/tests/question_type_test.php b/question/type/ddmarker/tests/question_type_test.php index 03acc328f28fa..8fafc48d51509 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() { diff --git a/question/type/ddwtos/tests/question_type_test.php b/question/type/ddwtos/tests/question_type_test.php index 347bc16926030..6951c2fd7e7bd 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 2c4f082dac822..83b04794663e7 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() { diff --git a/question/type/essay/tests/question_type_test.php b/question/type/essay/tests/question_type_test.php index 410ba2fd77998..068f96fb7da98 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 0ad8b3b40aff2..9cacaf19c2cec 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() { diff --git a/question/type/match/tests/question_type_test.php b/question/type/match/tests/question_type_test.php index 792011f21ef2f..55eb6eb4331b7 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 49a924b4f94c7..957ce29d13d64 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 2caba525bb032..4dc2281556107 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() { diff --git a/question/type/numerical/tests/answerprocessor_test.php b/question/type/numerical/tests/answerprocessor_test.php index fe3f9210f119c..eb2271331f1d6 100644 --- a/question/type/numerical/tests/answerprocessor_test.php +++ b/question/type/numerical/tests/answerprocessor_test.php @@ -44,6 +44,7 @@ public function setUp(): void { 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 9231ae63ae935..772c905fdc818 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 ed75bbee41105..d6c848dc7511e 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 f2d9e6f687b7e..cc0c5f726a1e7 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() { diff --git a/question/type/shortanswer/tests/question_type_test.php b/question/type/shortanswer/tests/question_type_test.php index a63728fcfb799..5575434d1ac31 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 b515c943438a9..d38e3031cb73c 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 @@ public function compare_response_with_answer(array $response, question_answer $a */ 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() { diff --git a/question/type/truefalse/tests/question_type_test.php b/question/type/truefalse/tests/question_type_test.php index 239718ff82ceb..0206d3e982e62 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() { diff --git a/rating/tests/externallib_test.php b/rating/tests/externallib_test.php index e4890ed1f76e4..d031dcb4b49e3 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 c3b58673e6109..cf081e43f1a21 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 c5ff682ba7d03..39c7654379ffe 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 c3984cf12c228..198cb2a9767e9 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 8afe9e428137c..0b26d247cb783 100644 --- a/report/log/tests/renderable_test.php +++ b/report/log/tests/renderable_test.php @@ -265,6 +265,7 @@ public static function get_group_list_provider(): array { * @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 cb57595a7858a..67ac7f1e47c9c 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 9f5dac1a14ee8..5c87e2236c25f 100644 --- a/report/loglive/tests/table_log_test.php +++ b/report/loglive/tests/table_log_test.php @@ -224,6 +224,7 @@ public static function get_report_logs_provider(): array { */ 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 bffc1fc2dbf7e..05a38bdea7e04 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 9704ea31b3025..fdce7e5ca2e63 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 c4034d31ffd77..1075ae7b23eff 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 f0d901b30428f..4f3f71ae83635 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 7e0962995b245..5e7d0fe56af9d 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 3a2c90e0641c7..4d73c920304a0 100644 --- a/reportbuilder/tests/external/system_report_exporter_test.php +++ b/reportbuilder/tests/external/system_report_exporter_test.php @@ -41,6 +41,7 @@ public static function setUpBeforeClass(): void { 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 1753b88beb366..d1245aac9a4d5 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 25c71114834e3..5f4938c555a36 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 544cec329cf62..5bb768682fda5 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 502329cd55c75..0df12d8a32048 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 a0d20e8a3151e..4cf474537035b 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 8982b8fe41973..b975832d1efa9 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 6b988f24a9357..0fc257409925f 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 270e1f841aa6c..38323c6fa2fc3 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 d6b4b845663f4..499deb643eb68 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 c44f41259409a..106d47e2c1ade 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 22fdc0ff59e5d..6ce920e0d1e2d 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 @@ public function tearDown(): void { $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 9bc628fb36f01..44407dd42e60c 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 7b52d2c97c7cf..eceb99fad1e3b 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 @@ public function tearDown(): void { $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 ebd615e48d8ef..118b014ec98c0 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 @@ public function tearDown(): void { $this->generator->teardown(); $this->generator = null; } + parent::tearDown(); } /** diff --git a/search/tests/base_test.php b/search/tests/base_test.php index a90589025607a..90fcb509e6032 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 @@ public function tearDown(): void { $this->generator->teardown(); $this->generator = null; } + parent::tearDown(); } /** diff --git a/search/tests/document_test.php b/search/tests/document_test.php index d7b83d1d0303b..c06a35c92d1c1 100644 --- a/search/tests/document_test.php +++ b/search/tests/document_test.php @@ -49,6 +49,7 @@ public static function setupBeforeClass(): void { protected $generator = null; public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); set_config('enableglobalsearch', true); @@ -134,6 +135,7 @@ public function tearDown(): void { $this->generator->teardown(); $this->generator = null; } + parent::tearDown(); } /** diff --git a/search/tests/engine_test.php b/search/tests/engine_test.php index 555818a755bde..760dde48b0baf 100644 --- a/search/tests/engine_test.php +++ b/search/tests/engine_test.php @@ -32,6 +32,7 @@ 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 414c212e359ab..6e1a12aafb698 100644 --- a/search/tests/external/get_results_test.php +++ b/search/tests/external/get_results_test.php @@ -35,6 +35,7 @@ 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 8ed8bb7492cc3..3bf89628b9921 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 @@ 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 8e034d2f3c79c..4de5b21d5bc98 100644 --- a/search/tests/external/get_top_results_test.php +++ b/search/tests/external/get_top_results_test.php @@ -35,6 +35,7 @@ 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 76ba009833ddc..634be3bbff889 100644 --- a/search/tests/external/view_results_test.php +++ b/search/tests/external/view_results_test.php @@ -35,6 +35,7 @@ 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 10ab44c9ec6c1..af1c852f36ea8 100644 --- a/search/tests/external_test.php +++ b/search/tests/external_test.php @@ -34,6 +34,7 @@ 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 c1363e687bca3..22614fd4331d0 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 8cac237e2dfab..9a2cc995f4f0e 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 1cc7f12759235..495c99afd94aa 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 37cf9e50621b5..f027716e252d7 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 d008e85951936..815c1aa1f85b6 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 640a67851ea2e..1d1c73ae6fc08 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 dc6f30b9c68ae..f33ae20e81117 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 fec6b397ca5ce..8ab37b5e20a2e 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 d32ec1711eb06..f2198672b2c0e 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 a4c020c6b0a79..78a67ad125185 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 3daa968211d60..fd20726a8e814 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 91ab540bd6bf0..7816fee120894 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 6ceef55058057..b7d4da05672ed 100644 --- a/webservice/tests/event/events_test.php +++ b/webservice/tests/event/events_test.php @@ -36,6 +36,7 @@ class events_test extends \advanced_testcase { public function setUp(): void { + parent::setUp(); $this->resetAfterTest(); }