Merge branch 'MDL-66902_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE

This commit is contained in:
Jun Pataleta
2022-09-28 23:15:26 +08:00
28 changed files with 69 additions and 211 deletions
@@ -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();
@@ -14,24 +14,19 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Unit tests for the import_handler_info class.
*
* @package tool_moodlenet
* @category test
* @copyright 2020 Jake Dallimore <jrhdallimore@gmail.com>
* @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 <jrhdallimore@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class import_handler_info_test extends \advanced_testcase {
@@ -14,15 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Unit tests for the import_handler_registry class.
*
* @package tool_moodlenet
* @category test
* @copyright 2020 Jake Dallimore <jrhdallimore@gmail.com>
* @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 <jrhdallimore@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class import_handler_registry_test extends \advanced_testcase {
@@ -14,24 +14,19 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Unit tests for the import_info class.
*
* @package tool_moodlenet
* @category test
* @copyright 2020 Jake Dallimore <jrhdallimore@gmail.com>
* @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 <jrhdallimore@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class import_info_test extends \advanced_testcase {
@@ -14,15 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Unit tests for the import_processor class.
*
* @package tool_moodlenet
* @category test
* @copyright 2020 Jake Dallimore <jrhdallimore@gmail.com>
* @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 <jrhdallimore@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class import_processor_test extends \advanced_testcase {
@@ -14,24 +14,19 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
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 <jrhdallimore@gmail.com>
* @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 {
/**
@@ -14,23 +14,18 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
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 <jrhdallimore@gmail.com>
* @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 {
/**
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace block_accessreview\tests;
namespace block_accessreview;
use ReflectionClass;
use advanced_testcase;
@@ -14,15 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Unit tests for core_grades\component_gradeitems;
*
* @package gradingform_guide
* @category test
* @copyright 2019 Andrew Nicols <andrew@nicols.co.uk>
* @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 <andrew@nicols.co.uk>
* @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;
@@ -14,15 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Unit tests for core_grades\component_gradeitems;
*
* @package gradingform_guide
* @category test
* @copyright 2019 Andrew Nicols <andrew@nicols.co.uk>
* @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 <andrew@nicols.co.uk>
* @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;
@@ -14,15 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Unit tests for core_grades\component_gradeitems;
*
* @package gradingform_rubric
* @category test
* @copyright 2019 Mathew May <mathew.solutions>
* @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 <mathew.solutions>
* @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;
@@ -14,15 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Unit tests for core_grades\component_gradeitems;
*
* @package gradingform_rubric
* @category test
* @copyright 2019 Mathew May <mathew.solutions>
* @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 <mathew.solutions>
* @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;
+1 -1
View File
@@ -25,7 +25,7 @@
declare(strict_types = 1);
namespace tests\core_grades {
namespace core_grades {
use advanced_testcase;
use core_grades\component_gradeitems;
@@ -14,15 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Unit tests for core_grades\component_gradeitems;
*
* @package core_grades
* @category test
* @copyright 2019 Andrew Nicols <andrew@nicols.co.uk>
* @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 <andrew@nicols.co.uk>
* @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;
@@ -14,15 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Unit tests for core_grades\component_gradeitems;
*
* @package core_grades
* @category test
* @copyright 2019 Andrew Nicols <andrew@nicols.co.uk>
* @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 <andrew@nicols.co.uk>
* @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;
@@ -14,15 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Unit tests for core_grades\component_gradeitems;
*
* @package core_grades
* @category test
* @copyright 2019 Andrew Nicols <andrew@nicols.co.uk>
* @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 <andrew@nicols.co.uk>
* @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;
@@ -14,15 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Unit tests for core_grades\component_gradeitems;
*
* @package core_grades
* @category test
* @copyright 2019 Andrew Nicols <andrew@nicols.co.uk>
* @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 <andrew@nicols.co.uk>
* @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;
@@ -14,16 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Testing the H5P H5PFileStorage interface implementation.
*
* @package core_h5p
* @category test
* @copyright 2019 Victor Deniz <victor@moodle.com>
* @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 <victor@moodle.com>
* @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;
@@ -14,14 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* 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;
@@ -14,23 +14,20 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
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 <brendan@catalyst-au.net>
* @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 <brendan@catalyst-au.net>
* @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 {
}
}
@@ -14,28 +14,21 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This file contains unit tests for the 'task running' data.
*
* @package core
* @copyright 2019 The Open University
* @copyright 2020 Mikhail Golenkov <golenkovm@gmail.com>
* @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.
@@ -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 <andrew@nicols.co.uk>
* @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;
/**
@@ -14,15 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Unit tests for mod_forum\grades\gradeitems.
*
* @package mod_forum
* @category test
* @copyright 2019 Andrew Nicols <andrew@nicols.co.uk>
* @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 <andrew@nicols.co.uk>
* @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.
@@ -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.