diff --git a/tests/adler_score_helpers_test.php b/tests/adler_score_helpers_test.php index f981ac4..133916c 100644 --- a/tests/adler_score_helpers_test.php +++ b/tests/adler_score_helpers_test.php @@ -4,7 +4,7 @@ global $CFG; -use local_adler\lib\local_adler_testcase; +use local_adler\lib\adler_testcase; use local_adler\lib\static_mock_utilities_trait; use local_adler\local\exceptions\not_an_adler_cm_exception; use moodle_exception; @@ -22,7 +22,7 @@ public function __construct(object $course_module, int $user_id = null) { } -class adler_score_helpers_test extends local_adler_testcase { +class adler_score_helpers_test extends adler_testcase { public function tearDown(): void { parent::tearDown(); diff --git a/tests/adler_score_test.php b/tests/adler_score_test.php index 84d499d..9113fad 100644 --- a/tests/adler_score_test.php +++ b/tests/adler_score_test.php @@ -5,7 +5,7 @@ use coding_exception; use completion_info; -use local_adler\lib\local_adler_testcase; +use local_adler\lib\adler_testcase; use local_adler\lib\static_mock_utilities_trait; use local_adler\local\exceptions\user_not_enrolled_exception; use local_logging\logger; @@ -58,7 +58,8 @@ public function test_get_score_item() { } -class adler_score_test extends local_adler_testcase { +class adler_score_test extends adler_testcase { + // TODO: Deprecated: Creation of dynamic property local_adler\adler_score_test::$course is deprecated in /home/runner/work/MoodlePluginLocal/MoodlePluginLocal/moodle/local/adler/tests/adler_score_test.php on line 69 (https://github.com/ProjektAdLer/MoodlePluginLocal/actions/runs/7917995524/job/21615389855) public function setUp(): void { parent::setUp(); diff --git a/tests/backup/moodle2/backup_local_adler_plugin_test.php b/tests/backup/moodle2/backup__adler_plugin_test.php similarity index 98% rename from tests/backup/moodle2/backup_local_adler_plugin_test.php rename to tests/backup/moodle2/backup__adler_plugin_test.php index 06a9e83..9229fa1 100644 --- a/tests/backup/moodle2/backup_local_adler_plugin_test.php +++ b/tests/backup/moodle2/backup__adler_plugin_test.php @@ -1,7 +1,7 @@ no namespace for this test as backup/restore is not namespaced -use local_adler\lib\local_adler_testcase; +use local_adler\lib\adler_testcase; global $CFG; require_once($CFG->dirroot . '/local/adler/tests/lib/adler_testcase.php'); @@ -14,7 +14,7 @@ * The only way to reliably recreate this object would be using the same code as the original class. * Therefore, this test is implemented as an integration test. */ -class backup_local_adler_plugin_test extends local_adler_testcase { +class backup__adler_plugin_test extends adler_testcase { public function setUp(): void { parent::setUp(); diff --git a/tests/backup/moodle2/restore_local_adler_plugin_test.php b/tests/backup/moodle2/restore__adler_plugin_test.php similarity index 99% rename from tests/backup/moodle2/restore_local_adler_plugin_test.php rename to tests/backup/moodle2/restore__adler_plugin_test.php index 18c897d..41af353 100644 --- a/tests/backup/moodle2/restore_local_adler_plugin_test.php +++ b/tests/backup/moodle2/restore__adler_plugin_test.php @@ -2,7 +2,7 @@ // When using namespaces, the namespace of the test class should match the namespace of the code under test // -> no namespace for this test as backup/restore is not namespaced -use local_adler\lib\local_adler_testcase; +use local_adler\lib\adler_testcase; global $CFG; require_once($CFG->dirroot . '/local/adler/tests/lib/adler_testcase.php'); @@ -13,7 +13,7 @@ /** * PHPunit test for class restore_local_adler_plugin */ -class restore_local_adler_plugin_test extends local_adler_testcase { +class restore__adler_plugin_test extends adler_testcase { public function setUpModule(): array { // stub the get_task() method to return a mock task object $stub_task = $this->getMockBuilder(restore_activity_task::class) diff --git a/tests/external/get_element_ids_by_uuids_test.php b/tests/external/get_element_ids_by_uuids_test.php index bd4aafd..341eb24 100644 --- a/tests/external/get_element_ids_by_uuids_test.php +++ b/tests/external/get_element_ids_by_uuids_test.php @@ -7,7 +7,7 @@ use context_module; use dml_exception; use invalid_parameter_exception; -use local_adler\lib\local_adler_externallib_testcase; +use local_adler\lib\adler_externallib_testcase; use Mockery; use ReflectionClass; use local_adler\local\section\db as section_db; @@ -20,7 +20,7 @@ /** * @runTestsInSeparateProcesses */ -class get_element_ids_by_uuids_test extends local_adler_externallib_testcase { +class get_element_ids_by_uuids_test extends adler_externallib_testcase { public function provide_test_execute_data() { return [ 'cm' => [ diff --git a/tests/external/lib_test.php b/tests/external/lib_test.php index e375007..763f5dc 100644 --- a/tests/external/lib_test.php +++ b/tests/external/lib_test.php @@ -8,12 +8,12 @@ use external_api; use invalid_parameter_exception; -use local_adler\lib\local_adler_externallib_testcase; +use local_adler\lib\adler_externallib_testcase; /** * @runTestsInSeparateProcesses */ -class lib_test extends local_adler_externallib_testcase { +class lib_test extends adler_externallib_testcase { /** * @param $class_to_test string|null Exactly this function is required in different API classes because they require a proxy function to this function. Therefore, this test is also valid for those API classes. This parameter allows exactly this. Pass the class name via classname::class. * @return void diff --git a/tests/external/score_get_course_scores_test.php b/tests/external/score_get_course_scores_test.php index 5c091a6..e50a716 100644 --- a/tests/external/score_get_course_scores_test.php +++ b/tests/external/score_get_course_scores_test.php @@ -5,7 +5,7 @@ use context_module; use local_adler\adler_score_helpers; -use local_adler\lib\local_adler_externallib_testcase; +use local_adler\lib\adler_externallib_testcase; use Mockery; use ReflectionClass; @@ -16,7 +16,7 @@ /** * @runTestsInSeparateProcesses */ -class score_get_course_scores_test extends local_adler_externallib_testcase { +class score_get_course_scores_test extends adler_externallib_testcase { public function provide_test_execute_data() { return [ 'success' => [ diff --git a/tests/external/score_get_element_scores_test.php b/tests/external/score_get_element_scores_test.php index 7a67912..8bbaaaf 100644 --- a/tests/external/score_get_element_scores_test.php +++ b/tests/external/score_get_element_scores_test.php @@ -8,7 +8,7 @@ use dml_missing_record_exception; use invalid_parameter_exception; use local_adler\adler_score_helpers_mock; -use local_adler\lib\local_adler_externallib_testcase; +use local_adler\lib\adler_externallib_testcase; use moodle_exception; use require_login_exception; use Throwable; @@ -21,7 +21,7 @@ * @runTestsInSeparateProcesses * @preserveGlobalState disabled */ -class score_get_element_scores_test extends local_adler_externallib_testcase { +class score_get_element_scores_test extends adler_externallib_testcase { public function test_execute() { global $CFG; require_once($CFG->dirroot . '/local/adler/tests/mocks.php'); diff --git a/tests/external/score_h5p_learning_element_test.php b/tests/external/score_h5p_learning_element_test.php index 92e72f2..b1f75e2 100644 --- a/tests/external/score_h5p_learning_element_test.php +++ b/tests/external/score_h5p_learning_element_test.php @@ -5,7 +5,7 @@ use context_module; use local_adler\adler_score_helpers; -use local_adler\lib\local_adler_externallib_testcase; +use local_adler\lib\adler_externallib_testcase; use Mockery; use moodle_exception; use ReflectionClass; @@ -23,7 +23,7 @@ * @runTestsInSeparateProcesses * @preserveGlobalState disabled */ -class score_h5p_learning_element_test extends local_adler_externallib_testcase { +class score_h5p_learning_element_test extends adler_externallib_testcase { public function provide_test_get_module_ids_from_xapi_data() { return [ [ diff --git a/tests/external/score_primitive_learning_element_test.php b/tests/external/score_primitive_learning_element_test.php index b946ece..4a2e016 100644 --- a/tests/external/score_primitive_learning_element_test.php +++ b/tests/external/score_primitive_learning_element_test.php @@ -8,7 +8,7 @@ use external_api; use invalid_parameter_exception; use local_adler\adler_score; -use local_adler\lib\local_adler_externallib_testcase; +use local_adler\lib\adler_externallib_testcase; global $CFG; @@ -20,7 +20,7 @@ * @runTestsInSeparateProcesses * @preserveGlobalState disabled */ -class score_primitive_learning_element_test extends local_adler_externallib_testcase { +class score_primitive_learning_element_test extends adler_externallib_testcase { // Define the properties explicitly public $course; public $course_module; diff --git a/tests/external/upload_course_test.php b/tests/external/upload_course_test.php index 782ce3d..7a5582d 100644 --- a/tests/external/upload_course_test.php +++ b/tests/external/upload_course_test.php @@ -6,7 +6,7 @@ use backup; use backup_controller; use invalid_parameter_exception; -use local_adler\lib\local_adler_externallib_testcase; +use local_adler\lib\adler_externallib_testcase; use local_adler\local\exceptions\not_an_adler_course_exception; use moodle_exception; @@ -17,7 +17,7 @@ /** * @runTestsInSeparateProcesses */ -class upload_course_test extends local_adler_externallib_testcase { +class upload_course_test extends adler_externallib_testcase { public function generate_mbz(bool $is_adler_course): string { global $CFG; require_once($CFG->dirroot . '/backup/util/includes/backup_includes.php'); diff --git a/tests/helpers_test.php b/tests/helpers_test.php index 5e338a4..69d32f9 100644 --- a/tests/helpers_test.php +++ b/tests/helpers_test.php @@ -3,13 +3,13 @@ namespace local_adler; -use local_adler\lib\local_adler_testcase; +use local_adler\lib\adler_testcase; use local_adler\lib\static_mock_utilities_trait; # import for other classes importing this class use moodle_exception; use Throwable; -class helpers_test extends local_adler_testcase { +class helpers_test extends adler_testcase { public function provide_test_course_is_adler_course_data(): array { return [ 'is adler course' => [['course_exist' => true, 'is_adler_course' => true, 'expected' => true]], diff --git a/tests/lib/adler_testcase.php b/tests/lib/adler_testcase.php index 1c710de..532ece9 100644 --- a/tests/lib/adler_testcase.php +++ b/tests/lib/adler_testcase.php @@ -41,11 +41,11 @@ public function tearDown(): void { } } -abstract class local_adler_testcase extends advanced_testcase { +abstract class adler_testcase extends advanced_testcase { use general_testcase_adjustments; } -abstract class local_adler_externallib_testcase extends externallib_advanced_testcase { +abstract class adler_externallib_testcase extends externallib_advanced_testcase { use general_testcase_adjustments { general_testcase_adjustments::setUp as protected setUpTrait; } diff --git a/tests/local/course_module/db_test.php b/tests/local/course_module/db_test.php index 1283598..e83480a 100644 --- a/tests/local/course_module/db_test.php +++ b/tests/local/course_module/db_test.php @@ -4,13 +4,13 @@ use dml_exception; -use local_adler\lib\local_adler_testcase; +use local_adler\lib\adler_testcase; global $CFG; require_once($CFG->dirroot . '/local/adler/tests/lib/adler_testcase.php'); -class db_test extends local_adler_testcase { +class db_test extends adler_testcase { public function setUp(): void { parent::setUp(); $this->adler_generator = $this->getDataGenerator()->get_plugin_generator('local_adler'); diff --git a/tests/local/section/db_test.php b/tests/local/section/db_test.php index 4dc911a..cbad376 100644 --- a/tests/local/section/db_test.php +++ b/tests/local/section/db_test.php @@ -4,14 +4,14 @@ use dml_exception; -use local_adler\lib\local_adler_testcase; +use local_adler\lib\adler_testcase; use Mockery; global $CFG; require_once($CFG->dirroot . '/local/adler/tests/lib/adler_testcase.php'); -class db_test extends local_adler_testcase { +class db_test extends adler_testcase { public function setUp(): void { parent::setUp(); $this->adler_generator = $this->getDataGenerator()->get_plugin_generator('local_adler'); diff --git a/tests/local/section/section_test.php b/tests/local/section/section_test.php index 9bea76b..5062df8 100644 --- a/tests/local/section/section_test.php +++ b/tests/local/section/section_test.php @@ -5,7 +5,7 @@ use completion_info; use local_adler\adler_score_helpers; -use local_adler\lib\local_adler_testcase; +use local_adler\lib\adler_testcase; use local_adler\local\exceptions\not_an_adler_section_exception; use ReflectionClass; @@ -13,7 +13,7 @@ require_once($CFG->dirroot . '/local/adler/tests/lib/adler_testcase.php'); -class section_test extends local_adler_testcase { +class section_test extends adler_testcase { public function provide_test_construct_data() { return [ 'valid section' => [ diff --git a/tests/observer_test.php b/tests/observer_test.php index 651ef98..69ce1c0 100644 --- a/tests/observer_test.php +++ b/tests/observer_test.php @@ -6,13 +6,13 @@ use core\event\course_deleted; use core\event\course_module_deleted; use core\event\course_section_deleted; -use local_adler\lib\local_adler_testcase; +use local_adler\lib\adler_testcase; global $CFG; require_once($CFG->dirroot . '/local/adler/tests/lib/adler_testcase.php'); -class observer_test extends local_adler_testcase { +class observer_test extends adler_testcase { public function test_course_content_deleted() { global $DB; diff --git a/tests/plugin_interface_test.php b/tests/plugin_interface_test.php index 110833a..a29af25 100644 --- a/tests/plugin_interface_test.php +++ b/tests/plugin_interface_test.php @@ -7,13 +7,13 @@ require_once($CFG->dirroot . '/local/adler/tests/lib/adler_testcase.php'); -use local_adler\lib\local_adler_testcase; +use local_adler\lib\adler_testcase; use local_adler\local\section\section; use local_adler\local\section\db as section_db; use Mockery; -class plugin_interface_test extends local_adler_testcase { +class plugin_interface_test extends adler_testcase { /** * @runInSeparateProcess * @preserveGlobalState disabled diff --git a/tests/uninstall_test.php b/tests/uninstall_test.php index 1f10ec7..cdf0f31 100644 --- a/tests/uninstall_test.php +++ b/tests/uninstall_test.php @@ -1,14 +1,14 @@ dirroot . '/local/adler/tests/lib/adler_testcase.php'); require_once($CFG->dirroot . '/local/adler/db/uninstall.php'); -class uninstall_test extends local_adler_testcase { +class uninstall_test extends adler_testcase { public function test_xmldb_local_adler_uninstall() { global $DB;