Merge branch 'MDL-75085-401-4' of https://github.com/junpataleta/moodle into MOODLE_401_STABLE

This commit is contained in:
Andrew Nicols 2023-02-02 12:02:47 +08:00
commit aa1b0c5ebd
5 changed files with 11 additions and 7 deletions

View File

@ -339,6 +339,7 @@ class core_completion_external extends external_api {
)
]
),
'Completion status details',
VALUE_DEFAULT,
[]
),

View File

@ -483,6 +483,7 @@ class core_course_external extends external_api {
'dataid' => new external_value(PARAM_NOTAGS, 'cm data id', VALUE_OPTIONAL),
)
),
'Course dates',
VALUE_DEFAULT,
[]
),
@ -514,7 +515,7 @@ class core_course_external extends external_api {
VALUE_OPTIONAL
),
)
), VALUE_DEFAULT, array()
), 'Course contents', VALUE_DEFAULT, array()
),
'contentsinfo' => new external_single_structure(
array(
@ -1305,7 +1306,7 @@ class core_course_external extends external_api {
'value' => new external_value(PARAM_RAW, 'the value for the option 1 (yes) or 0 (no)'
)
)
), VALUE_DEFAULT, array()
), 'Course duplication options', VALUE_DEFAULT, array()
),
)
);
@ -1532,7 +1533,7 @@ class core_course_external extends external_api {
'value' => new external_value(PARAM_RAW, 'the value for the option 1 (yes) or 0 (no)'
)
)
), VALUE_DEFAULT, array()
), 'Course import options', VALUE_DEFAULT, array()
),
)
);

View File

@ -95,7 +95,8 @@ class externallib_test extends \advanced_testcase {
$this->assertSame('666', $result['scalar']);
$params = array('text'=>'aaa');
$description = new \external_function_parameters(array('someid' => new \external_value(PARAM_INT, 'Some int value', false),
$description = new \external_function_parameters(array(
'someid' => new \external_value(PARAM_INT, 'Some int value', VALUE_DEFAULT),
'text' => new \external_value(PARAM_ALPHA, 'Some text value')));
$result = \external_api::validate_parameters($description, $params);
$this->assertCount(2, $result);
@ -105,7 +106,8 @@ class externallib_test extends \advanced_testcase {
$this->assertSame('aaa', $result['text']);
$params = array('text'=>'aaa');
$description = new \external_function_parameters(array('someid' => new \external_value(PARAM_INT, 'Some int value', false, 6),
$description = new \external_function_parameters(array(
'someid' => new \external_value(PARAM_INT, 'Some int value', VALUE_DEFAULT, 6),
'text' => new \external_value(PARAM_ALPHA, 'Some text value')));
$result = \external_api::validate_parameters($description, $params);
$this->assertCount(2, $result);

View File

@ -188,7 +188,7 @@ class mod_page_external extends external_api {
helper_for_get_mods_by_courses::standard_coursemodule_elements_returns(),
[
'content' => new external_value(PARAM_RAW, 'Page content'),
'contentformat' => new external_format_value('content', 'Content format'),
'contentformat' => new external_format_value('content', VALUE_REQUIRED, 'Content format'),
'contentfiles' => new external_files('Files in the content'),
'legacyfiles' => new external_value(PARAM_INT, 'Legacy files flag'),
'legacyfileslast' => new external_value(PARAM_INT, 'Legacy files last control flag'),

View File

@ -247,7 +247,7 @@ class core_tag_external extends external_api {
'name' => new external_value(PARAM_TAG, 'name'),
'rawname' => new external_value(PARAM_RAW, 'tag raw name (may contain capital letters)'),
'description' => new external_value(PARAM_RAW, 'tag description'),
'descriptionformat' => new external_format_value(PARAM_INT, 'tag description format'),
'descriptionformat' => new external_format_value(PARAM_INT, VALUE_REQUIRED, 'tag description format'),
'flag' => new external_value(PARAM_INT, 'flag', VALUE_OPTIONAL),
'official' => new external_value(PARAM_INT,
'whether this flag is standard (deprecated, use isstandard)', VALUE_OPTIONAL),