MDL-75777 phpunit: Move tests to use correct names and ns (take#6)

Applied the following changes to various testcase classes:

- Namespaced with component[\level2-API]
- Moved to level2-API subdirectory when required.
- Fixed incorrect use statements with leading backslash.
- Remove file phpdoc block
- Remove MOODLE_INTERNAL if not needed.
- Changed code to point to global scope when needed.
- Fix some relative paths and comments here and there.
- All them passing individually.
- Complete runs passing too.
This commit is contained in:
Eloy Lafuente (stronk7)
2022-09-19 11:02:50 +02:00
parent 844abeaf5d
commit be02cc3687
49 changed files with 636 additions and 722 deletions
+6 -5
View File
@@ -17,12 +17,15 @@
/**
* Unit tests for the question import and export system.
*
* @package moodlecore
* @subpackage questionbank
* @package core_question
* @category test
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_question;
use qformat_default;
defined('MOODLE_INTERNAL') || die();
@@ -30,7 +33,6 @@ global $CFG;
require_once($CFG->libdir . '/questionlib.php');
require_once($CFG->dirroot . '/question/format.php');
/**
* Subclass to make it easier to test qformat_default.
*
@@ -47,14 +49,13 @@ class testable_qformat extends qformat_default {
}
}
/**
* Unit tests for the matching question definition class.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class qformat_default_test extends advanced_testcase {
class importexport_test extends \advanced_testcase {
public function test_assemble_category_path() {
$format = new testable_qformat();
$pathsections = [