Skip to content

Commit

Permalink
MDL-40921 mod_workshop: Add assertEventContextNotUsed to events tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Damyon Wiese committed Feb 18, 2014
1 parent 5c219bb commit 603427a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions mod/workshop/tests/events_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ public function test_phase_switched_event() {
$expected = array($this->course->id, 'workshop', 'update switch phase', 'view.php?id=' . $this->workshop->id,
$this->workshop->phase, $this->cm->id);
$this->assertEventLegacyLogData($expected, $event);
$this->assertEventContextNotUsed($event);

$sink->close();
}
Expand All @@ -122,6 +123,7 @@ public function test_assessment_evaluated() {
$this->assertInstanceOf('\mod_workshop\event\assessment_evaluated', $event);
$this->assertEquals('workshop_aggregations', $event->objecttable);
$this->assertEquals(context_module::instance($cm->id), $event->get_context());
$this->assertEventContextNotUsed($event);

$sink->close();
}
Expand Down Expand Up @@ -150,6 +152,7 @@ public function test_assessment_reevaluated() {
$expected = array($this->course->id, 'workshop', 'update aggregate grade',
'view.php?id=' . $event->get_context()->instanceid, $event->objectid, $event->get_context()->instanceid);
$this->assertEventLegacyLogData($expected, $event);
$this->assertEventContextNotUsed($event);

$sink->close();
}
Expand Down Expand Up @@ -201,6 +204,7 @@ public function test_instances_list_viewed_event() {
// Check that the legacy log data is valid.
$expected = array($this->course->id, 'workshop', 'view all', 'index.php?id=' . $this->course->id, '');
$this->assertEventLegacyLogData($expected, $event);
$this->assertEventContextNotUsed($event);

$sink->close();
}
Expand Down Expand Up @@ -236,6 +240,7 @@ public function test_submission_created_event() {
$expected = array($this->course->id, 'workshop', 'add submission',
'submission.php?cmid=' . $this->workshop->id . '&id=' . $submissionid, $submissionid, $this->cm->id);
$this->assertEventLegacyLogData($expected, $event);
$this->assertEventContextNotUsed($event);

$sink->close();
}
Expand Down Expand Up @@ -271,6 +276,7 @@ public function test_submission_updated_event() {
$expected = array($this->course->id, 'workshop', 'update submission',
'submission.php?cmid=' . $this->workshop->id . '&id=' . $submissionid, $submissionid, $this->cm->id);
$this->assertEventLegacyLogData($expected, $event);
$this->assertEventContextNotUsed($event);

$sink->close();
}
Expand Down Expand Up @@ -306,6 +312,7 @@ public function test_submission_viewed_event() {
$expected = array($this->course->id, 'workshop', 'view submission',
'submission.php?cmid=' . $this->workshop->id . '&id=' . $submissionid, $submissionid, $this->cm->id);
$this->assertEventLegacyLogData($expected, $event);
$this->assertEventContextNotUsed($event);

$sink->close();
}
Expand Down

0 comments on commit 603427a

Please sign in to comment.