mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-58136 course: Remove lines from unit test
Remove unused vars and logic from the unit test for classifying a course.
This commit is contained in:
parent
c561297d26
commit
4c735661ad
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user