Permalink
Browse files

Merge branch 'MDL-63729-master' of git://github.com/dpalou/moodle

  • Loading branch information...
dmonllao committed Nov 13, 2018
2 parents bed93cf + ce908f7 commit 6101744b078774cc9f2e3b59534f9bf36bc2683f
Showing with 6 additions and 1 deletion.
  1. +6 −1 badges/tests/external_test.php
@@ -155,6 +155,7 @@ public function test_get_my_user_badges() {
$badges = (array) badges_get_user_badges($this->student->id);
$expectedbadges = array();
$coursebadge = null;
foreach ($badges as $badge) {
$context = ($badge->type == BADGE_TYPE_SITE) ? context_system::instance() : context_course::instance($badge->courseid);
@@ -196,6 +197,10 @@ public function test_get_my_user_badges() {
}
$expectedbadges[] = (array) $badge;
if (isset($badge->courseid)) {
// Save the course badge to be able to compare it in our tests.
$coursebadge = (array) $badge;
}
}
$result = core_badges_external::get_user_badges();
@@ -206,7 +211,7 @@ public function test_get_my_user_badges() {
$result = core_badges_external::get_user_badges(0, $this->course->id, 0, 1, '', true);
$result = external_api::clean_returnvalue(core_badges_external::get_user_badges_returns(), $result);
$this->assertCount(1, $result['badges']);
$this->assertEquals($expectedbadges[1], $result['badges'][0]);
$this->assertEquals($coursebadge, $result['badges'][0]);
}
/**

0 comments on commit 6101744

Please sign in to comment.