diff --git a/admin/tool/brickfield/tests/activityresults_test.php b/admin/tool/brickfield/tests/local/tool/activityresults_test.php
similarity index 100%
rename from admin/tool/brickfield/tests/activityresults_test.php
rename to admin/tool/brickfield/tests/local/tool/activityresults_test.php
diff --git a/admin/tool/brickfield/tests/checktyperesults_test.php b/admin/tool/brickfield/tests/local/tool/checktyperesults_test.php
similarity index 100%
rename from admin/tool/brickfield/tests/checktyperesults_test.php
rename to admin/tool/brickfield/tests/local/tool/checktyperesults_test.php
diff --git a/admin/tool/brickfield/tests/errors_test.php b/admin/tool/brickfield/tests/local/tool/errors_test.php
similarity index 100%
rename from admin/tool/brickfield/tests/errors_test.php
rename to admin/tool/brickfield/tests/local/tool/errors_test.php
diff --git a/admin/tool/brickfield/tests/printable_test.php b/admin/tool/brickfield/tests/local/tool/printable_test.php
similarity index 100%
rename from admin/tool/brickfield/tests/printable_test.php
rename to admin/tool/brickfield/tests/local/tool/printable_test.php
diff --git a/admin/tool/httpsreplace/tests/httpsreplace_test.php b/admin/tool/httpsreplace/tests/httpsreplace_test.php
index afc5cac9d0e..dcf3c221d2d 100644
--- a/admin/tool/httpsreplace/tests/httpsreplace_test.php
+++ b/admin/tool/httpsreplace/tests/httpsreplace_test.php
@@ -22,8 +22,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-namespace tool_httpsreplace\tests;
-
+namespace tool_httpsreplace;
defined('MOODLE_INTERNAL') || die();
diff --git a/admin/tool/moodlenet/tests/import_handler_info_test.php b/admin/tool/moodlenet/tests/local/import_handler_info_test.php
similarity index 95%
rename from admin/tool/moodlenet/tests/import_handler_info_test.php
rename to admin/tool/moodlenet/tests/local/import_handler_info_test.php
index 59f2db80e37..8535be29a33 100644
--- a/admin/tool/moodlenet/tests/import_handler_info_test.php
+++ b/admin/tool/moodlenet/tests/local/import_handler_info_test.php
@@ -14,24 +14,19 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
-/**
- * Unit tests for the import_handler_info class.
- *
- * @package tool_moodlenet
- * @category test
- * @copyright 2020 Jake Dallimore
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- */
-namespace tool_moodlenet\local\tests;
+namespace tool_moodlenet\local;
use tool_moodlenet\local\import_handler_info;
use tool_moodlenet\local\import_strategy;
use tool_moodlenet\local\import_strategy_file;
-defined('MOODLE_INTERNAL') || die();
-
/**
* Class tool_moodlenet_import_handler_info_testcase, providing test cases for the import_handler_info class.
+ *
+ * @package tool_moodlenet
+ * @category test
+ * @copyright 2020 Jake Dallimore
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class import_handler_info_test extends \advanced_testcase {
diff --git a/admin/tool/moodlenet/tests/import_handler_registry_test.php b/admin/tool/moodlenet/tests/local/import_handler_registry_test.php
similarity index 97%
rename from admin/tool/moodlenet/tests/import_handler_registry_test.php
rename to admin/tool/moodlenet/tests/local/import_handler_registry_test.php
index 957f9db40aa..0c679515f03 100644
--- a/admin/tool/moodlenet/tests/import_handler_registry_test.php
+++ b/admin/tool/moodlenet/tests/local/import_handler_registry_test.php
@@ -14,15 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
-/**
- * Unit tests for the import_handler_registry class.
- *
- * @package tool_moodlenet
- * @category test
- * @copyright 2020 Jake Dallimore
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- */
-namespace tool_moodlenet\local\tests;
+namespace tool_moodlenet\local;
use tool_moodlenet\local\import_handler_registry;
use tool_moodlenet\local\import_handler_info;
@@ -31,10 +23,13 @@ use tool_moodlenet\local\import_strategy_link;
use tool_moodlenet\local\remote_resource;
use tool_moodlenet\local\url;
-defined('MOODLE_INTERNAL') || die();
-
/**
* Class tool_moodlenet_import_handler_registry_testcase, providing test cases for the import_handler_registry class.
+ *
+ * @package tool_moodlenet
+ * @category test
+ * @copyright 2020 Jake Dallimore
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class import_handler_registry_test extends \advanced_testcase {
diff --git a/admin/tool/moodlenet/tests/import_info_test.php b/admin/tool/moodlenet/tests/local/import_info_test.php
similarity index 96%
rename from admin/tool/moodlenet/tests/import_info_test.php
rename to admin/tool/moodlenet/tests/local/import_info_test.php
index 40731d9bdc0..754fbbce8f1 100644
--- a/admin/tool/moodlenet/tests/import_info_test.php
+++ b/admin/tool/moodlenet/tests/local/import_info_test.php
@@ -14,24 +14,19 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
-/**
- * Unit tests for the import_info class.
- *
- * @package tool_moodlenet
- * @category test
- * @copyright 2020 Jake Dallimore
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- */
-namespace tool_moodlenet\local\tests;
+namespace tool_moodlenet\local;
use tool_moodlenet\local\import_info;
use tool_moodlenet\local\remote_resource;
use tool_moodlenet\local\url;
-defined('MOODLE_INTERNAL') || die();
-
/**
* Class tool_moodlenet_import_info_testcase, providing test cases for the import_info class.
+ *
+ * @package tool_moodlenet
+ * @category test
+ * @copyright 2020 Jake Dallimore
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class import_info_test extends \advanced_testcase {
diff --git a/admin/tool/moodlenet/tests/import_processor_test.php b/admin/tool/moodlenet/tests/local/import_processor_test.php
similarity index 98%
rename from admin/tool/moodlenet/tests/import_processor_test.php
rename to admin/tool/moodlenet/tests/local/import_processor_test.php
index 3721a68ca9c..26f73f668b1 100644
--- a/admin/tool/moodlenet/tests/import_processor_test.php
+++ b/admin/tool/moodlenet/tests/local/import_processor_test.php
@@ -14,15 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
-/**
- * Unit tests for the import_processor class.
- *
- * @package tool_moodlenet
- * @category test
- * @copyright 2020 Jake Dallimore
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- */
-namespace tool_moodlenet\local\tests;
+namespace tool_moodlenet\local;
use tool_moodlenet\local\import_handler_registry;
use tool_moodlenet\local\import_processor;
@@ -31,10 +23,13 @@ use tool_moodlenet\local\import_strategy_link;
use tool_moodlenet\local\remote_resource;
use tool_moodlenet\local\url;
-defined('MOODLE_INTERNAL') || die();
-
/**
* Class tool_moodlenet_import_processor_testcase, providing test cases for the import_processor class.
+ *
+ * @package tool_moodlenet
+ * @category test
+ * @copyright 2020 Jake Dallimore
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class import_processor_test extends \advanced_testcase {
diff --git a/admin/tool/moodlenet/tests/remote_resource_test.php b/admin/tool/moodlenet/tests/local/remote_resource_test.php
similarity index 96%
rename from admin/tool/moodlenet/tests/remote_resource_test.php
rename to admin/tool/moodlenet/tests/local/remote_resource_test.php
index cafab446f3f..500f95af4b2 100644
--- a/admin/tool/moodlenet/tests/remote_resource_test.php
+++ b/admin/tool/moodlenet/tests/local/remote_resource_test.php
@@ -14,24 +14,19 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
+namespace tool_moodlenet\local;
+
+use tool_moodlenet\local\remote_resource;
+use tool_moodlenet\local\url;
+
/**
- * Unit tests for the remote_resource class.
+ * Class tool_moodlenet_remote_resource_testcase, providing test cases for the remote_resource class.
*
* @package tool_moodlenet
* @category test
* @copyright 2020 Jake Dallimore
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-namespace tool_moodlenet\local\tests;
-
-use tool_moodlenet\local\remote_resource;
-use tool_moodlenet\local\url;
-
-defined('MOODLE_INTERNAL') || die();
-
-/**
- * Class tool_moodlenet_remote_resource_testcase, providing test cases for the remote_resource class.
- */
class remote_resource_test extends \advanced_testcase {
/**
diff --git a/admin/tool/moodlenet/tests/url_test.php b/admin/tool/moodlenet/tests/local/url_test.php
similarity index 96%
rename from admin/tool/moodlenet/tests/url_test.php
rename to admin/tool/moodlenet/tests/local/url_test.php
index 545e3ff5121..f48c0701140 100644
--- a/admin/tool/moodlenet/tests/url_test.php
+++ b/admin/tool/moodlenet/tests/local/url_test.php
@@ -14,23 +14,18 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
+namespace tool_moodlenet\local;
+
+use tool_moodlenet\local\url;
+
/**
- * Unit tests for the url class.
+ * Class tool_moodlenet_url_testcase, providing test cases for the url class.
*
* @package tool_moodlenet
* @category test
* @copyright 2020 Jake Dallimore
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-namespace tool_moodlenet\local\tests;
-
-use tool_moodlenet\local\url;
-
-defined('MOODLE_INTERNAL') || die();
-
-/**
- * Class tool_moodlenet_url_testcase, providing test cases for the url class.
- */
class url_test extends \advanced_testcase {
/**
diff --git a/blocks/accessreview/tests/accessibility_review_test.php b/blocks/accessreview/tests/accessibility_review_test.php
index db8a5b58d44..00f74ad458c 100644
--- a/blocks/accessreview/tests/accessibility_review_test.php
+++ b/blocks/accessreview/tests/accessibility_review_test.php
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
-namespace block_accessreview\tests;
+namespace block_accessreview;
use ReflectionClass;
use advanced_testcase;
diff --git a/blocks/badges/tests/badges_test.php b/blocks/badges/tests/badges_test.php
index d8a6c6b575f..2bd60e552f3 100644
--- a/blocks/badges/tests/badges_test.php
+++ b/blocks/badges/tests/badges_test.php
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
-namespace block_badges\tests;
+namespace block_badges;
use advanced_testcase;
use block_badges;
diff --git a/blocks/blog_menu/tests/blog_menu_test.php b/blocks/blog_menu/tests/blog_menu_test.php
index 2a5e66f2d05..be1d28e840e 100644
--- a/blocks/blog_menu/tests/blog_menu_test.php
+++ b/blocks/blog_menu/tests/blog_menu_test.php
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
-namespace block_blog_menu\tests;
+namespace block_blog_menu;
use advanced_testcase;
use block_blog_menu;
diff --git a/blocks/blog_recent/tests/blog_recent_test.php b/blocks/blog_recent/tests/blog_recent_test.php
index 88e1ec88cc6..6b69e6156bf 100644
--- a/blocks/blog_recent/tests/blog_recent_test.php
+++ b/blocks/blog_recent/tests/blog_recent_test.php
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
-namespace block_blog_recent\tests;
+namespace block_blog_recent;
use advanced_testcase;
use block_blog_recent;
diff --git a/blocks/blog_tags/tests/blog_tags_test.php b/blocks/blog_tags/tests/blog_tags_test.php
index 27f0fbd19ca..6244e7def80 100644
--- a/blocks/blog_tags/tests/blog_tags_test.php
+++ b/blocks/blog_tags/tests/blog_tags_test.php
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
-namespace block_blog_tags\tests;
+namespace block_blog_tags;
use advanced_testcase;
use block_blog_tags;
diff --git a/blocks/comments/tests/comments_test.php b/blocks/comments/tests/comments_test.php
index 2de1aaa36a7..e19eb26e23d 100644
--- a/blocks/comments/tests/comments_test.php
+++ b/blocks/comments/tests/comments_test.php
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
-namespace block_comments\tests;
+namespace block_comments;
use advanced_testcase;
use block_comments;
diff --git a/blocks/completionstatus/tests/completionstatus_test.php b/blocks/completionstatus/tests/completionstatus_test.php
index a05451fa116..deb92674091 100644
--- a/blocks/completionstatus/tests/completionstatus_test.php
+++ b/blocks/completionstatus/tests/completionstatus_test.php
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
-namespace block_completionstatus\tests;
+namespace block_completionstatus;
use advanced_testcase;
use block_completionstatus;
diff --git a/blocks/globalsearch/tests/globalsearch_test.php b/blocks/globalsearch/tests/globalsearch_test.php
index ade091083a8..29e438824aa 100644
--- a/blocks/globalsearch/tests/globalsearch_test.php
+++ b/blocks/globalsearch/tests/globalsearch_test.php
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
-namespace block_globalsearch\tests;
+namespace block_globalsearch;
use advanced_testcase;
use block_globalsearch;
diff --git a/blocks/glossary_random/tests/glossary_random_test.php b/blocks/glossary_random/tests/glossary_random_test.php
index 2b9e2b2d0d3..08b07821ceb 100644
--- a/blocks/glossary_random/tests/glossary_random_test.php
+++ b/blocks/glossary_random/tests/glossary_random_test.php
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
-namespace block_glossary_random\tests;
+namespace block_glossary_random;
use advanced_testcase;
use block_glossary_random;
diff --git a/blocks/lp/tests/lp_test.php b/blocks/lp/tests/lp_test.php
index 8b32ad7e268..d93d91c0521 100644
--- a/blocks/lp/tests/lp_test.php
+++ b/blocks/lp/tests/lp_test.php
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
-namespace block_lp\tests;
+namespace block_lp;
use advanced_testcase;
use block_lp;
diff --git a/blocks/mnet_hosts/tests/mnet_hosts_test.php b/blocks/mnet_hosts/tests/mnet_hosts_test.php
index e831f321cf0..a15a2ec8d35 100644
--- a/blocks/mnet_hosts/tests/mnet_hosts_test.php
+++ b/blocks/mnet_hosts/tests/mnet_hosts_test.php
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
-namespace block_mnet_hosts\tests;
+namespace block_mnet_hosts;
use advanced_testcase;
use block_mnet_hosts;
diff --git a/blocks/tags/tests/tags_test.php b/blocks/tags/tests/tags_test.php
index 8fcffd4d71f..4c69a5870c2 100644
--- a/blocks/tags/tests/tags_test.php
+++ b/blocks/tags/tests/tags_test.php
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
-namespace block_tags\tests;
+namespace block_tags;
use advanced_testcase;
use block_tags;
diff --git a/course/format/tests/state_test.php b/course/format/tests/output/local/state/state_test.php
similarity index 99%
rename from course/format/tests/state_test.php
rename to course/format/tests/output/local/state/state_test.php
index 1a66113e438..f39de5f30e6 100644
--- a/course/format/tests/state_test.php
+++ b/course/format/tests/output/local/state/state_test.php
@@ -16,8 +16,6 @@
namespace core_courseformat\output\local\state;
-defined('MOODLE_INTERNAL') || die();
-
/**
* Tests for state classes (course, section, cm).
*
@@ -37,6 +35,7 @@ class state_test extends \advanced_testcase {
require_once($CFG->dirroot . '/course/lib.php');
require_once($CFG->dirroot . '/course/format/tests/fixtures/format_theunittest.php');
require_once($CFG->dirroot . '/course/format/tests/fixtures/format_theunittest_output_course_format_state.php');
+ require_once($CFG->dirroot . '/lib/externallib.php');
}
/**
diff --git a/course/tests/course_delete_modules_test.php b/course/tests/course_delete_modules_test.php
index 6b39a8de621..72098f0b16a 100644
--- a/course/tests/course_delete_modules_test.php
+++ b/course/tests/course_delete_modules_test.php
@@ -22,9 +22,7 @@
* @copyright 2021 Tomo Tsuyuki
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-namespace tests\core_course;
-
-defined('MOODLE_INTERNAL') || die();
+namespace core_course;
/**
* Tests for the \core_course\task\course_delete_modules class.
diff --git a/course/tests/notifications_test.php b/course/tests/notifications_test.php
index 951d8b625e0..8dcb61f12bc 100644
--- a/course/tests/notifications_test.php
+++ b/course/tests/notifications_test.php
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
-namespace tests\core_course;
+namespace core_course;
/**
* Contains tests for course related notifications.
diff --git a/enrol/meta/tests/external_add_instances_test.php b/enrol/meta/tests/external/add_instances_test.php
similarity index 98%
rename from enrol/meta/tests/external_add_instances_test.php
rename to enrol/meta/tests/external/add_instances_test.php
index ea1baa905e1..16ce1643014 100644
--- a/enrol/meta/tests/external_add_instances_test.php
+++ b/enrol/meta/tests/external/add_instances_test.php
@@ -30,7 +30,7 @@ require_once($CFG->dirroot . '/webservice/tests/helpers.php');
* @copyright 2021 WKS KV Bildung
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-class external_add_instances_test extends \externallib_advanced_testcase {
+class add_instances_test extends \externallib_advanced_testcase {
/**
* Test setup
diff --git a/enrol/meta/tests/external_delete_instances_test.php b/enrol/meta/tests/external/delete_instances_test.php
similarity index 98%
rename from enrol/meta/tests/external_delete_instances_test.php
rename to enrol/meta/tests/external/delete_instances_test.php
index 58f6c47ad95..53c79dd74f6 100644
--- a/enrol/meta/tests/external_delete_instances_test.php
+++ b/enrol/meta/tests/external/delete_instances_test.php
@@ -30,7 +30,7 @@ require_once($CFG->dirroot . '/webservice/tests/helpers.php');
* @copyright 2021 WKS KV Bildung
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-class external_delete_instances_test extends \externallib_advanced_testcase {
+class delete_instances_test extends \externallib_advanced_testcase {
/**
* Test setup
diff --git a/grade/grading/form/guide/tests/grades_grader_gradingpanel_guide_external_fetch_test.php b/grade/grading/form/guide/tests/grades/grader/gradingpanel/external/fetch_test.php
similarity index 97%
rename from grade/grading/form/guide/tests/grades_grader_gradingpanel_guide_external_fetch_test.php
rename to grade/grading/form/guide/tests/grades/grader/gradingpanel/external/fetch_test.php
index 46f62b455db..cb86d137668 100644
--- a/grade/grading/form/guide/tests/grades_grader_gradingpanel_guide_external_fetch_test.php
+++ b/grade/grading/form/guide/tests/grades/grader/gradingpanel/external/fetch_test.php
@@ -14,15 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
-/**
- * Unit tests for core_grades\component_gradeitems;
- *
- * @package gradingform_guide
- * @category test
- * @copyright 2019 Andrew Nicols
- * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
- */
-
declare(strict_types = 1);
namespace gradingform_guide\grades\grader\gradingpanel\external;
@@ -42,7 +33,7 @@ use moodle_exception;
* @copyright 2019 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-class grades_grader_gradingpanel_guide_external_fetch_test extends advanced_testcase {
+class fetch_test extends advanced_testcase {
public static function setupBeforeClass(): void {
global $CFG;
diff --git a/grade/grading/form/guide/tests/grades_grader_gradingpanel_guide_external_store_test.php b/grade/grading/form/guide/tests/grades/grader/gradingpanel/external/store_test.php
similarity index 96%
rename from grade/grading/form/guide/tests/grades_grader_gradingpanel_guide_external_store_test.php
rename to grade/grading/form/guide/tests/grades/grader/gradingpanel/external/store_test.php
index f2bf5f33e26..5d649941608 100644
--- a/grade/grading/form/guide/tests/grades_grader_gradingpanel_guide_external_store_test.php
+++ b/grade/grading/form/guide/tests/grades/grader/gradingpanel/external/store_test.php
@@ -14,15 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
-/**
- * Unit tests for core_grades\component_gradeitems;
- *
- * @package gradingform_guide
- * @category test
- * @copyright 2019 Andrew Nicols
- * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
- */
-
declare(strict_types = 1);
namespace gradingform_guide\grades\grader\gradingpanel\external;
@@ -42,7 +33,7 @@ use moodle_exception;
* @copyright 2019 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-class grades_grader_gradingpanel_guide_external_store_test extends advanced_testcase {
+class store_test extends advanced_testcase {
public static function setupBeforeClass(): void {
global $CFG;
diff --git a/grade/grading/form/rubric/tests/grades_grader_gradingpanel_rubric_external_fetch_test.php b/grade/grading/form/rubric/tests/grades/grader/gradingpanel/external/fetch_test.php
similarity index 97%
rename from grade/grading/form/rubric/tests/grades_grader_gradingpanel_rubric_external_fetch_test.php
rename to grade/grading/form/rubric/tests/grades/grader/gradingpanel/external/fetch_test.php
index 42839ecb67b..68402617c40 100644
--- a/grade/grading/form/rubric/tests/grades_grader_gradingpanel_rubric_external_fetch_test.php
+++ b/grade/grading/form/rubric/tests/grades/grader/gradingpanel/external/fetch_test.php
@@ -14,15 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
-/**
- * Unit tests for core_grades\component_gradeitems;
- *
- * @package gradingform_rubric
- * @category test
- * @copyright 2019 Mathew May
- * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
- */
-
declare(strict_types = 1);
namespace gradingform_rubric\grades\grader\gradingpanel\external;
@@ -43,7 +34,7 @@ use moodle_exception;
* @copyright 2019 Mathew May
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-class grades_grader_gradingpanel_rubric_external_fetch_test extends advanced_testcase {
+class fetch_test extends advanced_testcase {
public static function setupBeforeClass(): void {
global $CFG;
diff --git a/grade/grading/form/rubric/tests/grades_grader_gradingpanel_rubric_external_store_test.php b/grade/grading/form/rubric/tests/grades/grader/gradingpanel/external/store_test.php
similarity index 96%
rename from grade/grading/form/rubric/tests/grades_grader_gradingpanel_rubric_external_store_test.php
rename to grade/grading/form/rubric/tests/grades/grader/gradingpanel/external/store_test.php
index ca6bfb209e7..f911134b18e 100644
--- a/grade/grading/form/rubric/tests/grades_grader_gradingpanel_rubric_external_store_test.php
+++ b/grade/grading/form/rubric/tests/grades/grader/gradingpanel/external/store_test.php
@@ -14,15 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
-/**
- * Unit tests for core_grades\component_gradeitems;
- *
- * @package gradingform_rubric
- * @category test
- * @copyright 2019 Mathew May
- * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
- */
-
declare(strict_types = 1);
namespace gradingform_rubric\grades\grader\gradingpanel\external;
@@ -42,7 +33,7 @@ use moodle_exception;
* @copyright 2019 Mathew May
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-class grades_grader_gradingpanel_rubric_external_store_test extends advanced_testcase {
+class store_test extends advanced_testcase {
public static function setupBeforeClass(): void {
global $CFG;
diff --git a/grade/tests/component_gradeitems_test.php b/grade/tests/component_gradeitems_test.php
index a84e5774f52..a37c22d01c2 100644
--- a/grade/tests/component_gradeitems_test.php
+++ b/grade/tests/component_gradeitems_test.php
@@ -25,7 +25,7 @@
declare(strict_types = 1);
-namespace tests\core_grades {
+namespace core_grades {
use advanced_testcase;
use core_grades\component_gradeitems;
diff --git a/grade/tests/grades_grader_gradingpanel_point_external_fetch_test.php b/grade/tests/grades/grader/gradingpanel/point/external/fetch_test.php
similarity index 96%
rename from grade/tests/grades_grader_gradingpanel_point_external_fetch_test.php
rename to grade/tests/grades/grader/gradingpanel/point/external/fetch_test.php
index 14104cb5e01..282d04b399a 100644
--- a/grade/tests/grades_grader_gradingpanel_point_external_fetch_test.php
+++ b/grade/tests/grades/grader/gradingpanel/point/external/fetch_test.php
@@ -14,15 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
-/**
- * Unit tests for core_grades\component_gradeitems;
- *
- * @package core_grades
- * @category test
- * @copyright 2019 Andrew Nicols
- * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
- */
-
declare(strict_types = 1);
namespace core_grades\grades\grader\gradingpanel\point\external;
@@ -42,7 +33,7 @@ use moodle_exception;
* @copyright 2019 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-class grades_grader_gradingpanel_point_external_fetch_test extends advanced_testcase {
+class fetch_test extends advanced_testcase {
public static function setupBeforeClass(): void {
global $CFG;
diff --git a/grade/tests/grades_grader_gradingpanel_point_external_store_test.php b/grade/tests/grades/grader/gradingpanel/point/external/store_test.php
similarity index 97%
rename from grade/tests/grades_grader_gradingpanel_point_external_store_test.php
rename to grade/tests/grades/grader/gradingpanel/point/external/store_test.php
index bc6a31e7b07..183d2ea8c96 100644
--- a/grade/tests/grades_grader_gradingpanel_point_external_store_test.php
+++ b/grade/tests/grades/grader/gradingpanel/point/external/store_test.php
@@ -14,15 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
-/**
- * Unit tests for core_grades\component_gradeitems;
- *
- * @package core_grades
- * @category test
- * @copyright 2019 Andrew Nicols
- * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
- */
-
declare(strict_types = 1);
namespace core_grades\grades\grader\gradingpanel\point\external;
@@ -44,7 +35,7 @@ use grade_item;
* @copyright 2019 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-class grades_grader_gradingpanel_point_external_store_test extends advanced_testcase {
+class store_test extends advanced_testcase {
public static function setupBeforeClass(): void {
global $CFG;
diff --git a/grade/tests/grades_grader_gradingpanel_scale_external_fetch_test.php b/grade/tests/grades/grader/gradingpanel/scale/external/fetch_test.php
similarity index 97%
rename from grade/tests/grades_grader_gradingpanel_scale_external_fetch_test.php
rename to grade/tests/grades/grader/gradingpanel/scale/external/fetch_test.php
index ffb99a299b8..a4bb51a82da 100644
--- a/grade/tests/grades_grader_gradingpanel_scale_external_fetch_test.php
+++ b/grade/tests/grades/grader/gradingpanel/scale/external/fetch_test.php
@@ -14,15 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
-/**
- * Unit tests for core_grades\component_gradeitems;
- *
- * @package core_grades
- * @category test
- * @copyright 2019 Andrew Nicols
- * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
- */
-
declare(strict_types = 1);
namespace core_grades\grades\grader\gradingpanel\scale\external;
@@ -42,7 +33,7 @@ use moodle_exception;
* @copyright 2019 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-class grades_grader_gradingpanel_scale_external_fetch_test extends advanced_testcase {
+class fetch_test extends advanced_testcase {
public static function setupBeforeClass(): void {
global $CFG;
diff --git a/grade/tests/grades_grader_gradingpanel_scale_external_store_test.php b/grade/tests/grades/grader/gradingpanel/scale/external/store_test.php
similarity index 98%
rename from grade/tests/grades_grader_gradingpanel_scale_external_store_test.php
rename to grade/tests/grades/grader/gradingpanel/scale/external/store_test.php
index 066ab6b5b60..96a0d8fc558 100644
--- a/grade/tests/grades_grader_gradingpanel_scale_external_store_test.php
+++ b/grade/tests/grades/grader/gradingpanel/scale/external/store_test.php
@@ -14,15 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
-/**
- * Unit tests for core_grades\component_gradeitems;
- *
- * @package core_grades
- * @category test
- * @copyright 2019 Andrew Nicols
- * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
- */
-
declare(strict_types = 1);
namespace core_grades\grades\grader\gradingpanel\scale\external;
@@ -44,7 +35,7 @@ use grade_item;
* @copyright 2019 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-class grades_grader_gradingpanel_scale_external_store_test extends advanced_testcase {
+class store_test extends advanced_testcase {
public static function setupBeforeClass(): void {
global $CFG;
diff --git a/h5p/tests/h5p_file_storage_test.php b/h5p/tests/file_storage_test.php
similarity index 99%
rename from h5p/tests/h5p_file_storage_test.php
rename to h5p/tests/file_storage_test.php
index 562fd4c941d..e81e804facf 100644
--- a/h5p/tests/h5p_file_storage_test.php
+++ b/h5p/tests/file_storage_test.php
@@ -14,16 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
-/**
- * Testing the H5P H5PFileStorage interface implementation.
- *
- * @package core_h5p
- * @category test
- * @copyright 2019 Victor Deniz
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- */
-
-namespace core_h5p\local\tests;
+namespace core_h5p;
use core_h5p\file_storage;
use core_h5p\local\library\autoloader;
@@ -38,11 +29,12 @@ use zip_archive;
* Test class covering the H5PFileStorage interface implementation.
*
* @package core_h5p
+ * @category test
* @copyright 2019 Victor Deniz
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @runTestsInSeparateProcesses
*/
-class h5p_file_storage_test extends \advanced_testcase {
+class file_storage_test extends \advanced_testcase {
/** @var \core_h5p\file_storage H5P file storage instance */
protected $h5p_file_storage;
diff --git a/lib/tests/completion_daily_task_test.php b/lib/tests/task/completion_daily_task_test.php
similarity index 96%
rename from lib/tests/completion_daily_task_test.php
rename to lib/tests/task/completion_daily_task_test.php
index baba7825ef7..fde8a40eaa9 100644
--- a/lib/tests/completion_daily_task_test.php
+++ b/lib/tests/task/completion_daily_task_test.php
@@ -14,14 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
-/**
- * Contains the class containing unit tests for the daily completion cron task.
- *
- * @package core
- * @copyright 2020 Jun Pataleta
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- */
-
namespace core\task;
use advanced_testcase;
diff --git a/lib/tests/task_manager_test.php b/lib/tests/task/manager_test.php
similarity index 97%
rename from lib/tests/task_manager_test.php
rename to lib/tests/task/manager_test.php
index b3007e9a265..4864369e97f 100644
--- a/lib/tests/task_manager_test.php
+++ b/lib/tests/task/manager_test.php
@@ -14,23 +14,20 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
+namespace core\task;
+
+defined('MOODLE_INTERNAL') || die();
+require_once(__DIR__ . '/../fixtures/task_fixtures.php');
+
/**
* This file contains the unit tests for the task manager.
*
* @package core
+ * @category test
* @copyright 2019 Brendan Heywood
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
-defined('MOODLE_INTERNAL') || die();
-
-/**
- * This file contains the unit tests for the task manager.
- *
- * @copyright 2019 Brendan Heywood
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- */
-class core_task_manager_testcase extends advanced_testcase {
+class manager_test extends \advanced_testcase {
public function test_ensure_adhoc_task_qos_provider() {
return [
@@ -194,4 +191,3 @@ class core_task_manager_testcase extends advanced_testcase {
}
}
-
diff --git a/lib/tests/task_running_test.php b/lib/tests/task/running_test.php
similarity index 94%
rename from lib/tests/task_running_test.php
rename to lib/tests/task/running_test.php
index 378101caf82..0cfb91e0a49 100644
--- a/lib/tests/task_running_test.php
+++ b/lib/tests/task/running_test.php
@@ -14,28 +14,21 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
-/**
- * This file contains unit tests for the 'task running' data.
- *
- * @package core
- * @copyright 2019 The Open University
- * @copyright 2020 Mikhail Golenkov
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- */
-
namespace core\task;
defined('MOODLE_INTERNAL') || die();
-require_once(__DIR__ . '/fixtures/task_fixtures.php');
+require_once(__DIR__ . '/../fixtures/task_fixtures.php');
/**
* This file contains unit tests for the 'task running' data.
*
+ * @package core
+ * @category test
* @copyright 2019 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-class task_running_test extends \advanced_testcase {
+class running_test extends \advanced_testcase {
/**
* Test for ad-hoc tasks.
diff --git a/mod/forum/tests/grades_forum_gradeitem_test.php b/mod/forum/tests/grade/forum_gradeitem_test.php
similarity index 97%
rename from mod/forum/tests/grades_forum_gradeitem_test.php
rename to mod/forum/tests/grade/forum_gradeitem_test.php
index a7da3930c25..be983a73135 100644
--- a/mod/forum/tests/grades_forum_gradeitem_test.php
+++ b/mod/forum/tests/grade/forum_gradeitem_test.php
@@ -30,7 +30,9 @@ use mod_forum\local\entities\forum as forum_entity;
use gradingform_controller;
use mod_forum\grades\forum_gradeitem;
-require_once(__DIR__ . '/generator_trait.php');
+defined('MOODLE_INTERNAL') || die();
+
+require_once(__DIR__ . '/../generator_trait.php');
/**
* Tests for the the Forum gradeitem.
@@ -39,7 +41,7 @@ require_once(__DIR__ . '/generator_trait.php');
* @copyright Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-class grades_forum_gradeitem_test extends \advanced_testcase {
+class forum_gradeitem_test extends \advanced_testcase {
use \mod_forum_tests_generator_trait;
/**
diff --git a/mod/forum/tests/grades_gradeitems_test.php b/mod/forum/tests/grade/gradeitems_test.php
similarity index 91%
rename from mod/forum/tests/grades_gradeitems_test.php
rename to mod/forum/tests/grade/gradeitems_test.php
index d3e2321bef0..404791ac8a4 100644
--- a/mod/forum/tests/grades_gradeitems_test.php
+++ b/mod/forum/tests/grade/gradeitems_test.php
@@ -14,15 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
-/**
- * Unit tests for mod_forum\grades\gradeitems.
- *
- * @package mod_forum
- * @category test
- * @copyright 2019 Andrew Nicols
- * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
- */
-
declare(strict_types = 1);
namespace mod_forum\grade;
@@ -39,7 +30,7 @@ use coding_exception;
* @copyright 2019 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-class grades_gradeitems_test extends advanced_testcase {
+class gradeitems_test extends advanced_testcase {
/**
* Ensure that the mappings are present and correct.
diff --git a/mod/forum/tests/h5p_canedit_test.php b/mod/forum/tests/h5p/canedit_test.php
similarity index 97%
rename from mod/forum/tests/h5p_canedit_test.php
rename to mod/forum/tests/h5p/canedit_test.php
index 64062a28018..17139438844 100644
--- a/mod/forum/tests/h5p_canedit_test.php
+++ b/mod/forum/tests/h5p/canedit_test.php
@@ -28,7 +28,7 @@ use stdClass;
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @coversDefaultClass \mod_forum\h5p\canedit
*/
-class h5p_canedit_test extends \advanced_testcase {
+class canedit_test extends \advanced_testcase {
/**
* Test the behaviour of can_edit_content().
@@ -86,7 +86,7 @@ class h5p_canedit_test extends \advanced_testcase {
// Create the file.
$filename = 'greeting-card-887.h5p';
- $path = __DIR__ . '/../../../h5p/tests/fixtures/' . $filename;
+ $path = __DIR__ . '/../../../../h5p/tests/fixtures/' . $filename;
if ($filecomponent === 'contentbank') {
$generator = $this->getDataGenerator()->get_plugin_generator('core_contentbank');
$contents = $generator->generate_contentbank_data(
@@ -114,7 +114,7 @@ class h5p_canedit_test extends \advanced_testcase {
}
// Check if the currentuser can edit the file.
- $result = \mod_forum\h5p\canedit::can_edit_content($file);
+ $result = canedit::can_edit_content($file);
$this->assertEquals($expected, $result);
}
diff --git a/mod/lti/tests/openidregistration_test.php b/mod/lti/tests/local/ltiopenid/registration_test.php
similarity index 98%
rename from mod/lti/tests/openidregistration_test.php
rename to mod/lti/tests/local/ltiopenid/registration_test.php
index dc266bc68dd..d700a6570f6 100644
--- a/mod/lti/tests/openidregistration_test.php
+++ b/mod/lti/tests/local/ltiopenid/registration_test.php
@@ -32,22 +32,17 @@
// of the Universitat Politecnica de Catalunya http://www.upc.edu
// Contact info: Marc Alier Forment granludo @ gmail.com or marc.alier @ upc.edu.
+namespace mod_lti\local\ltiopenid;
+
/**
- * This file contains unit tests for lti/openidregistrationlib.php
+ * OpenId LTI Registration library tests
*
* @package mod_lti
* @copyright 2020 Claude Vervoort, Cengage
* @author Claude Vervoort
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-namespace mod_lti\local\ltiopenid;
-use mod_lti\local\ltiopenid\registration_exception;
-use mod_lti\local\ltiopenid\registration_helper;
-
-/**
- * OpenId LTI Registration library tests
- */
-class openidregistration_test extends \advanced_testcase {
+class registration_test extends \advanced_testcase {
/**
* @var string A has-it-all client registration.