MDL-39923 badges: Fix unit tests

This commit is contained in:
Yuliya
2013-11-07 21:48:01 +13:00
parent f5d17c14ea
commit be2b37cf4b
2 changed files with 7 additions and 1 deletions
+5
View File
@@ -166,6 +166,7 @@ class core_badges_badgeslib_testcase extends advanced_testcase {
}
public function test_badge_awards() {
$this->preventResetByRollback(); // Messaging is not compatible with transactions.
$badge = new badge($this->badgeid);
$user1 = $this->getDataGenerator()->create_user();
@@ -225,6 +226,7 @@ class core_badges_badgeslib_testcase extends advanced_testcase {
* 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));
@@ -257,6 +259,7 @@ class core_badges_badgeslib_testcase extends advanced_testcase {
* 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));
@@ -282,6 +285,7 @@ class core_badges_badgeslib_testcase extends advanced_testcase {
* 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));
@@ -304,6 +308,7 @@ class core_badges_badgeslib_testcase extends advanced_testcase {
* 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));
+2 -1
View File
@@ -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;
}
}