Merge branch 'MDL-55611-master-fix' of git://github.com/andrewnicols/moodle

This commit is contained in:
Jake Dallimore 2017-04-06 09:23:29 +08:00
commit 6e58427458

View file

@ -208,7 +208,9 @@ class core_calendar_event_vault_testcase extends advanced_testcase {
$user = $this->getDataGenerator()->create_user(); $user = $this->getDataGenerator()->create_user();
// The factory will skip events with even ids. // The factory will skip events with even ids.
$factory = new action_event_test_factory(function($actionevent) { $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(); $strategy = new raw_event_retrieval_strategy();
$vault = new event_vault($factory, $strategy); $vault = new event_vault($factory, $strategy);