Merge branch 'MDL-80150-401' of https://github.com/lucaboesch/moodle into MOODLE_401_STABLE

This commit is contained in:
Sara Arjona 2023-11-29 13:34:52 +01:00
commit d8f055240a
No known key found for this signature in database
2 changed files with 3 additions and 0 deletions

View File

@ -227,6 +227,7 @@ function resource_get_coursemodule_info($coursemodule) {
if (count($files) >= 1) {
$mainfile = reset($files);
$resource->mainfile = $mainfile->get_filename();
$info->icon = file_file_icon($mainfile, 24);
}
$display = resource_get_final_display_type($resource);

View File

@ -144,11 +144,13 @@ class lib_test extends \advanced_testcase {
$info = resource_get_coursemodule_info(
$DB->get_record('course_modules', array('id' => $resource2->cmid)));
$this->assertEquals('R2', $info->name);
$this->assertEquals('f/text-24', $info->icon);
// For third one, it should use the highest sortorder icon.
$info = resource_get_coursemodule_info(
$DB->get_record('course_modules', array('id' => $resource3->cmid)));
$this->assertEquals('R3', $info->name);
$this->assertEquals('f/document-24', $info->icon);
}
public function test_resource_core_calendar_provide_event_action() {