Skip to content
Permalink
Browse files

MDL-41092 Assign: Expose SQL error in cron unit test

  • Loading branch information...
damyon committed Oct 30, 2013
1 parent 121de7f commit c2e79fd044621dc5b19f1817bd1fc4d414ec4d3d
Showing with 3 additions and 2 deletions.
  1. +3 −2 mod/assign/tests/locallib_test.php
@@ -450,16 +450,17 @@ public function test_cron() {
$data = new stdClass();
$data->grade = '50.0';
$assign->testable_apply_grade_to_user($data, $this->students[0]->id, 0);
$assign->testable_apply_grade_to_user($data, $this->students[1]->id, 0);
// Now run cron and see that one message was sent.
$this->preventResetByRollback();
$sink = $this->redirectMessages();
cron_setup_user();
$this->expectOutputRegex('/Done processing 1 assignment submissions/');
$this->expectOutputRegex('/Done processing 2 assignment submissions/');
assign::cron();
$messages = $sink->get_messages();
$this->assertEquals(1, count($messages));
$this->assertEquals(2, count($messages));
$this->assertEquals(1, $messages[0]->notification);
$this->assertEquals($assign->get_instance()->name, $messages[0]->contexturlname);
}

0 comments on commit c2e79fd

Please sign in to comment.
You can’t perform that action at this time.