Skip to content
Permalink
Browse files

MDL-61265 enrol: Add default numsections for external db

  • Loading branch information...
sarjona committed Jan 24, 2018
1 parent b63a3b0 commit 9390fc58290e355aa34991583a475a141420aa46
Showing with 8 additions and 0 deletions.
  1. +1 −0 enrol/database/lib.php
  2. +7 −0 enrol/database/tests/sync_test.php
@@ -774,6 +774,7 @@ public function sync_courses(progress_trace $trace) {
$template->summary = '';
$template->summaryformat = FORMAT_HTML;
$template->format = $courseconfig->format;
$template->numsections = $courseconfig->numsections;
$template->newsitems = $courseconfig->newsitems;
$template->showgrades = $courseconfig->showgrades;
$template->showreports = $courseconfig->showreports;
@@ -730,6 +730,13 @@ public function test_sync_courses() {
$this->assertEquals(1, $DB->count_records('course', array('idnumber' => 'yy')));
$this->assertEquals(1, $DB->count_records('course', array('shortname' => 'xx')));
// Check default number of sections matches with the created course sections.
$recordcourse1 = $DB->get_record('course', $course1);
$courseconfig = get_config('moodlecourse');
$numsections = $DB->count_records('course_sections', array('course' => $recordcourse1->id));
// To compare numsections we have to add topic 0 to default numsections.
$this->assertEquals(($courseconfig->numsections + 1), $numsections);
// Test category mapping via idnumber.

0 comments on commit 9390fc5

Please sign in to comment.
You can’t perform that action at this time.