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-04-26 13:34:29 +02:00
parent 80f521eed0
commit b2a485e244
No known key found for this signature in database
GPG key ID: 53487A05E6228820
18 changed files with 96 additions and 49 deletions

View file

@ -269,8 +269,6 @@ class question_test extends \advanced_testcase {
$this->resetAfterTest();
$qtype = new qtype_calculated();
// Create a question.
$q = \test_question_maker::get_question_data('calculated', 'mult');
$q->id = 99;
@ -284,6 +282,7 @@ class question_test extends \advanced_testcase {
$units[] = $unit;
$DB->insert_records("question_numerical_units", $units);
$qtype = new qtype_calculated();
$qtypeobj = question_bank::get_qtype($qtype->name());
$fakedata = ["a" => "5.7", "b" => "3.3"];