Commit e7b161f0 authored by Marina Glancy's avatar Marina Glancy
Browse files

MDL-44640 course: account for multiple events in course actions

parent ad704e2c
......@@ -1603,7 +1603,7 @@ class core_course_courselib_testcase extends advanced_testcase {
$sink->close();
// Validate the event.
$event = $events[0];
$event = array_pop($events);
$this->assertInstanceOf('\core\event\course_created', $event);
$this->assertEquals('course', $event->objecttable);
$this->assertEquals($course->id, $event->objectid);
......@@ -1633,7 +1633,7 @@ class core_course_courselib_testcase extends advanced_testcase {
$imstestcase->imsplugin->cron();
$events = $sink->get_events();
$sink->close();
$event = $events[0];
$event = array_pop($events);
// Validate the event triggered is \core\event\course_created. There is no need to validate the other values
// as they have already been validated in the previous steps. Here we only want to make sure that when the
......@@ -1750,7 +1750,7 @@ class core_course_courselib_testcase extends advanced_testcase {
$sink->close();
// Validate the event.
$event = $events[1];
$event = array_pop($events);
$this->assertInstanceOf('\core\event\course_deleted', $event);
$this->assertEquals('course', $event->objecttable);
$this->assertEquals($course->id, $event->objectid);
......@@ -1802,7 +1802,7 @@ class core_course_courselib_testcase extends advanced_testcase {
$sink->close();
// Validate the event.
$event = $events[0];
$event = array_pop($events);
$this->assertInstanceOf('\core\event\course_content_deleted', $event);
$this->assertEquals('course', $event->objecttable);
$this->assertEquals($course->id, $event->objectid);
......@@ -1927,7 +1927,7 @@ class core_course_courselib_testcase extends advanced_testcase {
$sink->close();
// Validate the event.
$event = $events[0];
$event = array_pop($events);
$this->assertInstanceOf('\core\event\course_restored', $event);
$this->assertEquals('course', $event->objecttable);
$this->assertEquals($rc->get_courseid(), $event->objectid);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment