MDL-33600 Assign: Allow teachers to skip notifying students about grade update.

This commit is contained in:
Damyon Wiese 2013-12-16 11:27:23 +08:00
parent ab7f498343
commit f7dc9871e7
4 changed files with 21 additions and 2 deletions

View file

@ -536,6 +536,9 @@ class mod_assign_locallib_testcase extends mod_assign_base_testcase {
$assign->testable_apply_grade_to_user($data, $this->students[0]->id, 0);
$assign->testable_apply_grade_to_user($data, $this->students[1]->id, 0);
$data->sendstudentnotifications = false;
$assign->testable_apply_grade_to_user($data, $this->students[2]->id, 0);
// Now run cron and see that one message was sent.
$this->preventResetByRollback();
$sink = $this->redirectMessages();
@ -544,6 +547,7 @@ class mod_assign_locallib_testcase extends mod_assign_base_testcase {
assign::cron();
$messages = $sink->get_messages();
// The sent count should be 2, because the 3rd one was marked as do not send notifications.
$this->assertEquals(2, count($messages));
$this->assertEquals(1, $messages[0]->notification);
$this->assertEquals($assign->get_instance()->name, $messages[0]->contexturlname);