This commit is contained in:
Andrew Nicols 2020-11-19 10:40:47 +08:00
commit e988d9ec4d
2 changed files with 4 additions and 1 deletions

View File

@ -197,6 +197,7 @@ class mod_folder_external extends external_api {
'display' => new external_value(PARAM_INT, 'Display type of folder contents on a separate page or inline'), 'display' => new external_value(PARAM_INT, 'Display type of folder contents on a separate page or inline'),
'showexpanded' => new external_value(PARAM_INT, '1 = expanded, 0 = collapsed for sub-folders'), 'showexpanded' => new external_value(PARAM_INT, '1 = expanded, 0 = collapsed for sub-folders'),
'showdownloadfolder' => new external_value(PARAM_INT, 'Whether to show the download folder button'), 'showdownloadfolder' => new external_value(PARAM_INT, 'Whether to show the download folder button'),
'forcedownload' => new external_value(PARAM_INT, 'Whether file download is forced'),
'section' => new external_value(PARAM_INT, 'Course section id'), 'section' => new external_value(PARAM_INT, 'Course section id'),
'visible' => new external_value(PARAM_INT, 'Module visibility'), 'visible' => new external_value(PARAM_INT, 'Module visibility'),
'groupmode' => new external_value(PARAM_INT, 'Group mode'), 'groupmode' => new external_value(PARAM_INT, 'Group mode'),

View File

@ -131,11 +131,13 @@ class mod_folder_external_testcase extends externallib_advanced_testcase {
// First folder. // First folder.
$record = new stdClass(); $record = new stdClass();
$record->course = $course1->id; $record->course = $course1->id;
$record->forcedownload = 1;
$folder1 = self::getDataGenerator()->create_module('folder', $record); $folder1 = self::getDataGenerator()->create_module('folder', $record);
// Second folder. // Second folder.
$record = new stdClass(); $record = new stdClass();
$record->course = $course2->id; $record->course = $course2->id;
$record->forcedownload = 0;
$folder2 = self::getDataGenerator()->create_module('folder', $record); $folder2 = self::getDataGenerator()->create_module('folder', $record);
// Execute real Moodle enrolment as we'll call unenrol() method on the instance later. // Execute real Moodle enrolment as we'll call unenrol() method on the instance later.
@ -154,7 +156,7 @@ class mod_folder_external_testcase extends externallib_advanced_testcase {
// Create what we expect to be returned when querying the two courses. // Create what we expect to be returned when querying the two courses.
$expectedfields = array('id', 'coursemodule', 'course', 'name', 'intro', 'introformat', 'introfiles', 'revision', $expectedfields = array('id', 'coursemodule', 'course', 'name', 'intro', 'introformat', 'introfiles', 'revision',
'timemodified', 'display', 'showexpanded', 'showdownloadfolder', 'section', 'visible', 'timemodified', 'display', 'showexpanded', 'showdownloadfolder', 'section', 'visible',
'groupmode', 'groupingid'); 'forcedownload', 'groupmode', 'groupingid');
// Add expected coursemodule and data. // Add expected coursemodule and data.
$folder1->coursemodule = $folder1->cmid; $folder1->coursemodule = $folder1->cmid;