MDL-81698 phpunit: Apply various fixes towards 1by1 execution

The changes here are heterogeneous:
- Include stuff that is not available (other test has included it).
  Sometimes local to a unit test, others in setupBeforeClass() or
  globally, ... depends on every case.
- Rename some tests (namespaces, test name, ...) towards getting it
  running.
- Amend small bits here and there.

Important note: I've left any "cosmetic" warning out from the
changes, only a few errors (like long array syntax) have been fixed.
This commit is contained in:
Eloy Lafuente (stronk7)
2024-05-25 17:19:52 +02:00
parent 80f521eed0
commit b2a485e244
18 changed files with 96 additions and 49 deletions
+2 -2
View File
@@ -485,7 +485,7 @@ class logging_test extends \advanced_testcase {
// Note PHPUnit does not support mocking static functions.
$CFG->task_log_class = logging_test_mocked_logger::class;
logging_test_mocked_logger::test_reset();
logging_test_mocked_logger::reset_test();
return $CFG->task_log_class;
}
@@ -533,7 +533,7 @@ class logging_test_mocked_logger implements task_logger {
/**
* Reset the test class.
*/
public static function test_reset() {
public static function reset_test() {
self::$isconfigured = true;
self::$storelogfortask = [];
self::$haslogreport = true;