From 45cc006c9158cd48bf894b51397bc5e4b1dfff3a Mon Sep 17 00:00:00 2001 From: Amaia Anabitarte Date: Tue, 11 Dec 2018 19:06:52 +0100 Subject: [PATCH] MDL-60518 core_competency: Set $USER global variable for tests --- competency/tests/api_test.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/competency/tests/api_test.php b/competency/tests/api_test.php index 00371527d8d2d..705a32a65faec 100644 --- a/competency/tests/api_test.php +++ b/competency/tests/api_test.php @@ -2501,6 +2501,10 @@ public function test_add_evidence_user_competency_course_grade_in_course() { $this->resetAfterTest(true); $dg = $this->getDataGenerator(); + // Create and assign a current user. + $currentuser = $dg->create_user(); + $this->setUser($currentuser); + // Create a course. $course = $dg->create_course(); $record = array('courseid' => $course->id, 'pushratingstouserplans' => false);