mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 02:16:41 +02:00
MDL-64820 core: Exporter read_definition
Modified the read_properties_definition to recursively check and set the default array values expected.
This commit is contained in:
parent
3271c39c74
commit
432cdac4bd
2 changed files with 29 additions and 4 deletions
|
@ -179,6 +179,8 @@ class core_exporter_testcase extends advanced_testcase {
|
|||
$this->assertEquals('otherstring description', $properties['otherstring']['description']);
|
||||
// Other properties default description.
|
||||
$this->assertEquals('otherstrings', $properties['otherstrings']['description']);
|
||||
// Assert nested elements are formatted correctly.
|
||||
$this->assertEquals('id', $properties['nestedarray']['type']['id']['description']);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -228,6 +230,13 @@ class core_testable_exporter extends \core\external\exporter {
|
|||
'otherstrings' => array(
|
||||
'type' => PARAM_TEXT,
|
||||
'multiple' => true
|
||||
),
|
||||
'nestedarray' => array(
|
||||
'multiple' => true,
|
||||
'optional' => true,
|
||||
'type' => [
|
||||
'id' => ['type' => PARAM_INT]
|
||||
]
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue