Merge branch 'MDL-55611_master' of git://github.com/markn86/moodle

This commit is contained in:
Andrew Nicols 2017-04-06 13:24:05 +08:00
commit ffc4b7e4af
2 changed files with 6 additions and 4 deletions

View File

@ -164,7 +164,7 @@ class event_vault implements event_vault_interface {
$coursesfilter,
$where,
$params,
"timesort ASC, id ASC",
"e.timesort ASC, e.id ASC",
$offset,
$limitnum,
$ignorehidden

View File

@ -206,7 +206,7 @@ class core_calendar_event_vault_testcase extends advanced_testcase {
$this->setAdminuser();
$user = $this->getDataGenerator()->create_user();
// The factory will skip events with even ids.
// The factory will return every event that is divisible by 2.
$factory = new action_event_test_factory(function($actionevent) {
static $count = 0;
$count++;
@ -642,9 +642,11 @@ class core_calendar_event_vault_testcase extends advanced_testcase {
$user = $this->getDataGenerator()->create_user();
$course1 = $this->getDataGenerator()->create_course();
$course2 = $this->getDataGenerator()->create_course();
// The factory will skip events with even ids.
// The factory will return every event that is divisible by 2.
$factory = new action_event_test_factory(function($actionevent) {
return ($actionevent->get_id() % 2) ? false : true;
static $count = 0;
$count++;
return ($count % 2) ? true : false;
});
$strategy = new raw_event_retrieval_strategy();
$vault = new event_vault($factory, $strategy);