Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 3.7.9, 3.8.6, 3.9.3, 3.10
-
Component/s: Gradebook, Unit tests
-
Labels:
-
Testing Instructions:
-
Affected Branches:MOODLE_310_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE
-
Fixed Branches:MOODLE_310_STABLE, MOODLE_39_STABLE
-
Pull from Repository:
-
Pull 3.8 Branch:
MDL-70245-MOODLE_38_STABLE -
Pull 3.9 Branch:
MDL-70245-MOODLE_39_STABLE -
Pull 3.10 Branch:
MDL-70245-MOODLE_310_STABLE -
Pull Master Branch:
MDL-70245-master -
Pull Master Diff URL:
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")