mirror of
https://github.com/moodle/moodle.git
synced 2025-03-20 07:30:01 +01:00
Merge branch 'MDL-75173-fix' of https://github.com/sarjona/moodle
This commit is contained in:
commit
6237c41397
@ -283,9 +283,10 @@ class api_test extends \advanced_testcase {
|
||||
$coursecompletionid = \core_completion\api::mark_course_completions_activity_criteria();
|
||||
$this->assertEquals(0, $coursecompletionid);
|
||||
$actual = $DB->get_records('course_completions');
|
||||
$students = [$student1->id, $student2->id];
|
||||
$this->assertEquals(2, count($actual));
|
||||
$this->assertEquals($student1->id, reset($actual)->userid);
|
||||
$this->assertEquals($student2->id, end($actual)->userid);
|
||||
$this->assertContains(reset($actual)->userid, $students);
|
||||
$this->assertContains(end($actual)->userid, $students);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -378,9 +379,10 @@ class api_test extends \advanced_testcase {
|
||||
$this->assertEquals($student1->id, reset($actual)->userid);
|
||||
} else {
|
||||
// Both students completed a course.
|
||||
$students = [$student1->id, $student2->id];
|
||||
$this->assertEquals(2, count($actual));
|
||||
$this->assertEquals($student1->id, reset($actual)->userid);
|
||||
$this->assertEquals($student2->id, end($actual)->userid);
|
||||
$this->assertContains(reset($actual)->userid, $students);
|
||||
$this->assertContains(end($actual)->userid, $students);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user