diff --git a/calendar/tests/event_vault_test.php b/calendar/tests/event_vault_test.php index 1d57d1db9d2..0d522497629 100644 --- a/calendar/tests/event_vault_test.php +++ b/calendar/tests/event_vault_test.php @@ -208,7 +208,9 @@ class core_calendar_event_vault_testcase extends advanced_testcase { $user = $this->getDataGenerator()->create_user(); // The factory will skip events with even ids. $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);