Skip to content

Commit

Permalink
MDL-54751 core_course: Fixed event type checks in adhoc deletion tests
Browse files Browse the repository at this point in the history
  • Loading branch information
snake committed Nov 8, 2016
1 parent 3e85e02 commit 89e20c7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions course/tests/courselib_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -3582,7 +3582,8 @@ public function test_async_section_deletion_hook_implemented() {
$count = 0;
while (!empty($events)) {
$event = array_pop($events);
if (in_array($event->objectid, [$assign0->cmid, $assign1->cmid, $assign2->cmid])) {
if ($event instanceof \core\event\course_module_deleted &&
in_array($event->objectid, [$assign0->cmid, $assign1->cmid, $assign2->cmid])) {
$count++;
}
}
Expand Down Expand Up @@ -3657,7 +3658,8 @@ public function test_async_section_deletion_hook_not_implemented() {
$count = 0;
while (!empty($events)) {
$event = array_pop($events);
if (in_array($event->objectid, [$assign0->cmid, $assign1->cmid])) {
if ($event instanceof \core\event\course_module_deleted &&
in_array($event->objectid, [$assign0->cmid, $assign1->cmid])) {
$count++;
}
}
Expand Down

0 comments on commit 89e20c7

Please sign in to comment.