Skip to content

Commit

Permalink
MDL-60243 competencies: fix ordering bug in api_test unit test
Browse files Browse the repository at this point in the history
list_user_competencies_to_review() orders by shortname, but the test
creates 2 user competencies with the same short name, resulting in
unpredictable results. This patch fixes that.
  • Loading branch information
snake committed Sep 27, 2017
1 parent 22e99d6 commit 54ec938
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion competency/tests/api_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -4588,6 +4588,7 @@ public function test_list_user_competencies_to_review() {
$c1 = $ccg->create_competency(['competencyframeworkid' => $f1->get('id')]);
$c2 = $ccg->create_competency(['competencyframeworkid' => $f1->get('id')]);
$c3 = $ccg->create_competency(['competencyframeworkid' => $f1->get('id')]);
$c4 = $ccg->create_competency(['competencyframeworkid' => $f1->get('id')]);
$uc1a = $ccg->create_user_competency(['userid' => $u1->id, 'competencyid' => $c1->get('id'),
'status' => user_competency::STATUS_IDLE]);
$uc1b = $ccg->create_user_competency(['userid' => $u1->id, 'competencyid' => $c2->get('id'),
Expand All @@ -4600,7 +4601,7 @@ public function test_list_user_competencies_to_review() {
'status' => user_competency::STATUS_IDLE]);
$uc2c = $ccg->create_user_competency(['userid' => $u2->id, 'competencyid' => $c3->get('id'),
'status' => user_competency::STATUS_IN_REVIEW]);
$uc3a = $ccg->create_user_competency(['userid' => $u3->id, 'competencyid' => $c3->get('id'),
$uc3a = $ccg->create_user_competency(['userid' => $u3->id, 'competencyid' => $c4->get('id'),
'status' => user_competency::STATUS_WAITING_FOR_REVIEW]);

// The reviewer can review all plans waiting for review, or in review where they are the reviewer.
Expand Down

0 comments on commit 54ec938

Please sign in to comment.