MDL-73971 phpunit: Move more tests to use correct names and namespaces

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.

Special mention to:

- Some fixtures, initially defined in the test files have been
  moved to new files in fixtures subdirectory, leaving the unit
  test files clearer:
  - moodle2_course_format_test.php
- Rename wrong named test:
  - baseoptiogroup_test = baseoptigroup_test
This commit is contained in:
Eloy Lafuente (stronk7)
2022-05-06 18:29:24 +02:00
parent 199974b45d
commit 1c33085ede
143 changed files with 1946 additions and 2337 deletions
@@ -14,18 +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/>.
/**
* Course module competency persistent class tests.
*
* @package core_competency
* @copyright 2019 Damyon Wiese
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
global $CFG;
use core_competency\course_module_competency;
namespace core_competency;
/**
* Course module competency persistent testcase.
@@ -34,7 +23,7 @@ use core_competency\course_module_competency;
* @copyright 2019 Damyon Wiese
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class core_competency_course_module_competency_testcase extends advanced_testcase {
class course_module_competency_test extends \advanced_testcase {
public function test_count_competencies() {
global $CFG, $DB;