Skip to content

Commit

Permalink
MDL-39923 badges: Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuliya committed Nov 7, 2013
1 parent f5d17c1 commit be2b37c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions badges/tests/badgeslib_test.php
Expand Up @@ -166,6 +166,7 @@ public function test_delete_badge_criteria() {
}

public function test_badge_awards() {
$this->preventResetByRollback(); // Messaging is not compatible with transactions.
$badge = new badge($this->badgeid);
$user1 = $this->getDataGenerator()->create_user();

Expand Down Expand Up @@ -225,6 +226,7 @@ public function test_badge_message_from_template($message, $params, $result) {
* Test badges observer when course module completion event id fired.
*/
public function test_badges_observer_course_module_criteria_review() {
$this->preventResetByRollback(); // Messaging is not compatible with transactions.
$badge = new badge($this->coursebadge);
$this->assertFalse($badge->is_issued($this->user->id));

Expand Down Expand Up @@ -257,6 +259,7 @@ public function test_badges_observer_course_module_criteria_review() {
* Test badges observer when course_completed event is fired.
*/
public function test_badges_observer_course_criteria_review() {
$this->preventResetByRollback(); // Messaging is not compatible with transactions.
$badge = new badge($this->coursebadge);
$this->assertFalse($badge->is_issued($this->user->id));

Expand All @@ -282,6 +285,7 @@ public function test_badges_observer_course_criteria_review() {
* Test badges observer when user_updated event is fired.
*/
public function test_badges_observer_profile_criteria_review() {
$this->preventResetByRollback(); // Messaging is not compatible with transactions.
$badge = new badge($this->coursebadge);
$this->assertFalse($badge->is_issued($this->user->id));

Expand All @@ -304,6 +308,7 @@ public function test_badges_observer_profile_criteria_review() {
* Test badges assertion generated when a badge is issued.
*/
public function test_badges_assertion() {
$this->preventResetByRollback(); // Messaging is not compatible with transactions.
$badge = new badge($this->coursebadge);
$this->assertFalse($badge->is_issued($this->user->id));

Expand Down
3 changes: 2 additions & 1 deletion lib/badgeslib.php
Expand Up @@ -978,7 +978,8 @@ function badges_bake($hash, $badgeid, $userid = 0, $pathhash = false) {
}
}
} else {
debugging('Error baking badge image!');
debugging('Error baking badge image!', DEBUG_DEVELOPER);
return;
}
}

Expand Down

0 comments on commit be2b37c

Please sign in to comment.