Permalink
Browse files

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

  • Loading branch information...
dmonllao authored and snake committed Jan 30, 2018
2 parents e57392f + e3c04bd commit 5cce9a8fff20eba8988f62030ad7b2d40a964aa4
Showing with 8 additions and 0 deletions.
  1. +2 −0 calendar/externallib.php
  2. +3 −0 calendar/tests/externallib_test.php
  3. +3 −0 calendar/upgrade.txt
@@ -356,6 +356,8 @@ public static function get_calendar_events_returns() {
'description' => new external_value(PARAM_RAW, 'Description', VALUE_OPTIONAL, null, NULL_ALLOWED),
'format' => new external_format_value('description'),
'courseid' => new external_value(PARAM_INT, 'course id'),
'categoryid' => new external_value(PARAM_INT, 'Category id (only for category events).',
VALUE_OPTIONAL),
'groupid' => new external_value(PARAM_INT, 'group id'),
'userid' => new external_value(PARAM_INT, 'user id'),
'repeatid' => new external_value(PARAM_INT, 'repeat id'),
@@ -506,6 +506,7 @@ public function test_get_calendar_events() {
// Should be just one, since there's just one category event of the course I am enrolled (course3 - cat2b).
$this->assertEquals(1, count($events['events']));
$this->assertEquals($catevent2->id, $events['events'][0]['id']);
$this->assertEquals($category2->id, $events['events'][0]['categoryid']);
$this->assertEquals(0, count($events['warnings']));
// Now get category events but by course (there aren't course events in the course).
@@ -536,7 +537,9 @@ public function test_get_calendar_events() {
$this->assertEquals(2, count($events['events']));
$this->assertEquals(0, count($events['warnings']));
$this->assertEquals($catevent1->id, $events['events'][0]['id']);
$this->assertEquals($category->id, $events['events'][0]['categoryid']);
$this->assertEquals($catevent2->id, $events['events'][1]['id']);
$this->assertEquals($category2->id, $events['events'][1]['categoryid']);
}
/**
@@ -1,6 +1,9 @@
This files describes API changes in /calendar/* ,
information provided here is intended especially for developers.
=== 3.5 ===
* core_calendar_external::get_calendar_events now returns the categoryid for category events.
=== 3.4 ===
* calendar_get_mini, and calendar_get_upcoming have been deprecated. Please update to use the new exporters and renderers.
* added core_calendar_get_valid_event_timestart_range and core_calendar_event_timestart_updated callbacks for module events

0 comments on commit 5cce9a8

Please sign in to comment.