mirror of
https://github.com/moodle/moodle.git
synced 2025-04-14 13:02:07 +02:00
MDL-73278 phpunit: Fix namespaces for the renamed classes
Within the renamed classes in the previous commit, there were a few incorrect namespace, this commit fixes all them to be correct component[\api] ones. Also fix a few incorrect leading backslashes in namespace/use statements. And tests extending renamed tests.
This commit is contained in:
parent
deb0e76eee
commit
61f5c2038b
@ -22,7 +22,7 @@
|
||||
* @copyright 2020 Jake Dallimore <jrhdallimore@gmail.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
namespace tests\core_course;
|
||||
namespace core_course;
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
namespace tests\core_course;
|
||||
namespace core_course;
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
@ -31,6 +31,7 @@ global $CFG;
|
||||
require_once($CFG->dirroot . '/course/tests/fixtures/mock_hooks.php');
|
||||
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use core_course\test\mock_hooks;
|
||||
|
||||
/**
|
||||
* Functional test for class core_course_category methods invoking hooks.
|
||||
|
@ -22,7 +22,7 @@
|
||||
* @copyright 2020 Jake Dallimore <jrhdallimore@gmail.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
namespace tests\core_course;
|
||||
namespace core_course;
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
|
@ -22,7 +22,7 @@
|
||||
* @copyright 2020 Jake Dallimore <jrhdallimore@gmail.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
namespace tests\core_course;
|
||||
namespace core_course;
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
|
@ -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 tests\core_course;
|
||||
namespace core_course;
|
||||
|
||||
use context_user;
|
||||
use context_course;
|
||||
|
@ -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 tests\core_course;
|
||||
namespace core_course;
|
||||
|
||||
use core_course\external\course_summary_exporter;
|
||||
use context_user;
|
||||
|
@ -22,7 +22,7 @@
|
||||
* @copyright 2020 Jake Dallimore <jrhdallimore@gmail.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
namespace tests\core_course;
|
||||
namespace core_course;
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
|
@ -22,7 +22,7 @@
|
||||
* @copyright 2020 Jake Dallimore <jrhdallimore@gmail.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
namespace tests\core_course;
|
||||
namespace core_course;
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
|
22
course/tests/fixtures/mock_hooks.php
vendored
22
course/tests/fixtures/mock_hooks.php
vendored
@ -23,7 +23,7 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
namespace tests\core_course {
|
||||
namespace core_course\test {
|
||||
|
||||
/**
|
||||
* Class mock_hooks
|
||||
@ -129,13 +129,15 @@ namespace tests\core_course {
|
||||
|
||||
namespace {
|
||||
|
||||
use core_course\test\mock_hooks;
|
||||
|
||||
/**
|
||||
* Test pre_course_category_delete callback.
|
||||
*
|
||||
* @param object $category
|
||||
*/
|
||||
function tool_unittest_pre_course_category_delete(object $category) {
|
||||
\tests\core_course\mock_hooks::set_calling_arguments(func_get_args());
|
||||
mock_hooks::set_calling_arguments(func_get_args());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -145,7 +147,7 @@ namespace {
|
||||
* @param core_course_category $newcategory
|
||||
*/
|
||||
function tool_unittest_pre_course_category_delete_move(core_course_category $category, core_course_category $newcategory) {
|
||||
\tests\core_course\mock_hooks::set_calling_arguments(func_get_args());
|
||||
mock_hooks::set_calling_arguments(func_get_args());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -155,8 +157,8 @@ namespace {
|
||||
* @return bool
|
||||
*/
|
||||
function tool_unittest_can_course_category_delete(core_course_category $category) {
|
||||
\tests\core_course\mock_hooks::set_calling_arguments(func_get_args());
|
||||
return \tests\core_course\mock_hooks::get_can_course_category_delete_return();
|
||||
mock_hooks::set_calling_arguments(func_get_args());
|
||||
return mock_hooks::get_can_course_category_delete_return();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -167,8 +169,8 @@ namespace {
|
||||
* @return bool
|
||||
*/
|
||||
function tool_unittest_can_course_category_delete_move(core_course_category $category, core_course_category $newcategory) {
|
||||
\tests\core_course\mock_hooks::set_calling_arguments(func_get_args());
|
||||
return \tests\core_course\mock_hooks::get_can_course_category_delete_move_return();
|
||||
mock_hooks::set_calling_arguments(func_get_args());
|
||||
return mock_hooks::get_can_course_category_delete_move_return();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -178,7 +180,7 @@ namespace {
|
||||
* @return string
|
||||
*/
|
||||
function tool_unittest_get_course_category_contents(core_course_category $category) {
|
||||
\tests\core_course\mock_hooks::set_calling_arguments(func_get_args());
|
||||
return \tests\core_course\mock_hooks::get_get_course_category_contents_return();
|
||||
mock_hooks::set_calling_arguments(func_get_args());
|
||||
return mock_hooks::get_get_course_category_contents_return();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -22,12 +22,12 @@
|
||||
* @copyright 2020 Jake Dallimore <jrhdallimore@gmail.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
namespace tests\course;
|
||||
namespace core_course;
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
use \core_course\local\service\content_item_service;
|
||||
use \core_course\local\repository\content_item_readonly_repository;
|
||||
use core_course\local\service\content_item_service;
|
||||
use core_course\local\repository\content_item_readonly_repository;
|
||||
|
||||
/**
|
||||
* The tests for the content_item_service class.
|
||||
|
@ -23,7 +23,7 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
namespace tests\gradingform_guide;
|
||||
namespace gradingform_guide;
|
||||
|
||||
use context_module;
|
||||
use gradingform_controller;
|
||||
|
@ -23,7 +23,7 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
namespace tests\gradingform_rubric;
|
||||
namespace gradingform_rubric;
|
||||
|
||||
use advanced_testcase;
|
||||
use context_module;
|
||||
|
@ -23,7 +23,7 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
namespace tests\gradingform_rubric;
|
||||
namespace gradingform_rubric;
|
||||
|
||||
use core_privacy\tests\provider_testcase;
|
||||
use core_privacy\local\request\writer;
|
||||
|
@ -23,7 +23,7 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
namespace tests\core_grading;
|
||||
namespace core_grading;
|
||||
|
||||
use advanced_testcase;
|
||||
use context_module;
|
||||
|
@ -34,7 +34,7 @@ require_once($CFG->dirroot . '/mod/assign/tests/privacy_test.php');
|
||||
* @copyright 2018 Adrian Greeve <adrian@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class assignfeedback_comments_privacy_testcase extends \mod_assign\tests\mod_assign_privacy_testcase {
|
||||
class assignfeedback_comments_privacy_testcase extends \mod_assign\tests\privacy_test {
|
||||
|
||||
/**
|
||||
* Convenience function for creating feedback data.
|
||||
|
@ -37,7 +37,7 @@ use \mod_assign\privacy\assign_plugin_request_data;
|
||||
* @copyright 2018 Adrian Greeve <adrian@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class assignfeedback_editpdf_privacy_testcase extends \mod_assign\tests\mod_assign_privacy_testcase {
|
||||
class assignfeedback_editpdf_privacy_testcase extends \mod_assign\tests\privacy_test {
|
||||
|
||||
public function setUp(): void {
|
||||
// Skip this test if ghostscript is not supported.
|
||||
|
@ -36,7 +36,7 @@ use mod_assign\privacy\assign_plugin_request_data;
|
||||
* @copyright 2018 Adrian Greeve <adrian@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class assignfeedback_file_privacy_testcase extends \mod_assign\tests\mod_assign_privacy_testcase {
|
||||
class assignfeedback_file_privacy_testcase extends \mod_assign\tests\privacy_test {
|
||||
|
||||
/**
|
||||
* Convenience function for creating feedback data.
|
||||
|
@ -33,7 +33,7 @@ require_once($CFG->dirroot . '/mod/assign/tests/privacy_test.php');
|
||||
* @copyright 2018 Adrian Greeve <adrian@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class assignsubmission_comments_privacy_testcase extends \mod_assign\tests\mod_assign_privacy_testcase {
|
||||
class assignsubmission_comments_privacy_testcase extends \mod_assign\tests\privacy_test {
|
||||
|
||||
/**
|
||||
* Convenience function for creating feedback data.
|
||||
|
@ -33,7 +33,7 @@ require_once($CFG->dirroot . '/mod/assign/tests/privacy_test.php');
|
||||
* @copyright 2018 Adrian Greeve <adrian@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class assignsubmission_file_privacy_testcase extends \mod_assign\tests\mod_assign_privacy_testcase {
|
||||
class assignsubmission_file_privacy_testcase extends \mod_assign\tests\privacy_test {
|
||||
|
||||
/**
|
||||
* Convenience function for creating feedback data.
|
||||
|
@ -33,7 +33,7 @@ require_once($CFG->dirroot . '/mod/assign/tests/privacy_test.php');
|
||||
* @copyright 2018 Adrian Greeve <adrian@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class assignsubmission_online_privacy_testcase extends \mod_assign\tests\mod_assign_privacy_testcase {
|
||||
class assignsubmission_online_privacy_testcase extends \mod_assign\tests\privacy_test {
|
||||
|
||||
/**
|
||||
* Convenience function for creating feedback data.
|
||||
|
@ -22,7 +22,7 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
namespace tests\mod_forum\grades;
|
||||
namespace mod_forum\grade;
|
||||
|
||||
use core_grades\component_gradeitem;
|
||||
use mod_forum\grades\forum_gradeitem as gradeitem;
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
declare(strict_types = 1);
|
||||
|
||||
namespace tests\mod_forum\grades;
|
||||
namespace mod_forum\grade;
|
||||
|
||||
use advanced_testcase;
|
||||
use core_grades\component_gradeitems;
|
||||
|
Loading…
x
Reference in New Issue
Block a user