Merge branch 'MDL-67246-master' of git://github.com/jleyva/moodle

This commit is contained in:
Jun Pataleta 2019-11-14 14:34:17 +08:00
commit ff175fce22
2 changed files with 14 additions and 0 deletions

View File

@ -299,6 +299,13 @@ class api {
$settings->calendar_maxevents = $CFG->calendar_maxevents;
}
if (empty($section) or $section == 'coursecolors') {
$colornumbers = range(1, 10);
foreach ($colornumbers as $number) {
$settings->{'core_admin_coursecolor' . $number} = get_config('core_admin', 'coursecolor' . $number);
}
}
return $settings;
}

View File

@ -222,6 +222,13 @@ class tool_mobile_external_testcase extends externallib_advanced_testcase {
array('name' => 'calendar_lookahead', 'value' => $CFG->calendar_lookahead),
array('name' => 'calendar_maxevents', 'value' => $CFG->calendar_maxevents),
);
$colornumbers = range(1, 10);
foreach ($colornumbers as $number) {
$expected[] = [
'name' => 'core_admin_coursecolor' . $number,
'value' => get_config('core_admin', 'coursecolor' . $number)
];
}
$this->assertCount(0, $result['warnings']);
$this->assertEquals($expected, $result['settings']);