-
Bug
-
Resolution: Fixed
-
Minor
-
3.7.9, 3.8.6, 3.9.3, 3.10
-
MOODLE_310_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE
-
MOODLE_310_STABLE, MOODLE_39_STABLE
-
MDL-70245-master -
When the unit test tries to validate "finalgrade" with different set of grade max, then it will fail after "test_upgrade_calculated_grade_items_freeze" function in core_testsuite because the static $cache variable does not reset and the "minmaxtouse" collides with previous unit tests.
Steps to reproduce:
- Write unit test (attached in MDL-70245-patch.txt
) that implement to validate "finalgrade" with different set of grademax (for course category and grade item) after the function "test_upgrade_calculated_grade_items_freeze" .
- Run vendor/bin/phpunit --testsuite=core_testsuite
Expected:
Unit tests pass
Actual:
Unit tests fail with unexpected "finalgrade" getting returned (because it is using the previous "minmaxtouse" which is set in the function "test_upgrade_calculated_grade_items_freeze")