Merge branch 'MDL-68388_38' of https://github.com/stronk7/moodle into MOODLE_38_STABLE

This commit is contained in:
Sara Arjona
2020-05-26 20:03:45 +02:00
2 changed files with 8 additions and 4 deletions
+4 -1
View File
@@ -229,8 +229,11 @@ if (!$edit) {
}
}
// Cache the changed letters.
if (!empty($letters)) {
// Ensure that the letters are correctly sorted.
// For some reason, the cache saves it in the order in which they were entered
// but we really want to order them in descending order so we sort it here.
krsort($letters);
$cache->set($context->id, $letters);
}
+4 -3
View File
@@ -87,7 +87,7 @@ class core_gradelib_testcase extends advanced_testcase {
$letters = $cache->get($context->id);
$this->assertEquals(1, count($letters));
$this->assertEquals($letter->letter, $letters['100.00000']);
$this->assertTrue(in_array($letter->letter, $letters));
remove_grade_letters($context, false);
@@ -249,7 +249,8 @@ class core_gradelib_testcase extends advanced_testcase {
/**
* Test the caching of grade letters.
*/
public function test_get_grade_letters(): void {
public function test_get_grade_letters() {
$this->resetAfterTest();
$course = $this->getDataGenerator()->create_course();
@@ -272,7 +273,7 @@ class core_gradelib_testcase extends advanced_testcase {
/**
* Test custom letters.
*/
public function test_get_grade_letters_custom(): void {
public function test_get_grade_letters_custom() {
global $DB;
$this->resetAfterTest();