From 4c735661adb54c8fc6ae9896cfc7443919b5a2f2 Mon Sep 17 00:00:00 2001 From: Damyon Wiese Date: Tue, 13 Jun 2017 15:06:20 +0800 Subject: [PATCH] MDL-58136 course: Remove lines from unit test Remove unused vars and logic from the unit test for classifying a course. --- course/tests/courselib_test.php | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/course/tests/courselib_test.php b/course/tests/courselib_test.php index 3ae8f0d307a..349ecc4b892 100644 --- a/course/tests/courselib_test.php +++ b/course/tests/courselib_test.php @@ -3685,11 +3685,10 @@ class core_course_courselib_testcase extends advanced_testcase { $this->assertEquals(2, $count); } - function test_classify_course_for_timeline() { + public function test_classify_course_for_timeline() { global $DB, $CFG; require_once($CFG->dirroot.'/completion/criteria/completion_criteria_self.php'); - require_once($CFG->dirroot.'/completion/cron.php'); set_config('enablecompletion', COMPLETION_ENABLED); @@ -3706,11 +3705,8 @@ class core_course_courselib_testcase extends advanced_testcase { $inprogresscourse = $generator->create_course(); // Set completion rules. - $completion = new completion_info($completedcourse); - $criteriadata = new stdClass(); $criteriadata->id = $completedcourse->id; - $criteriadata->criteria_activity = array(); // Self completion. $criteriadata->criteria_self = COMPLETION_CRITERIA_TYPE_SELF; @@ -3718,15 +3714,6 @@ class core_course_courselib_testcase extends advanced_testcase { $criterion = new $class(); $criterion->update_config($criteriadata); - // Handle overall aggregation. - $aggdata = array( - 'course' => $completedcourse->id, - 'criteriatype' => null - ); - $aggregation = new completion_aggregation($aggdata); - $aggregation->setMethod(COMPLETION_AGGREGATION_ALL); - $aggregation->save(); - $user = $this->getDataGenerator()->create_user(); $studentrole = $DB->get_record('role', array('shortname' => 'student')); $this->getDataGenerator()->enrol_user($user->id, $futurecourse->id, $studentrole->id);