Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
3.7.9, 3.8.6, 3.9.3, 3.10
Description
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")