diff --git a/availability/tests/info_test.php b/availability/tests/info_test.php index 1477978f8b1..d349b9c2dc0 100644 --- a/availability/tests/info_test.php +++ b/availability/tests/info_test.php @@ -45,9 +45,10 @@ class info_testcase extends advanced_testcase { * Tests the info_module class (is_available, get_full_information). */ public function test_info_module() { - global $DB; + global $DB, $CFG; // Create a course and pages. + $CFG->enableavailability = 0; $this->setAdminUser(); $this->resetAfterTest(); $generator = $this->getDataGenerator(); @@ -160,6 +161,7 @@ class info_testcase extends advanced_testcase { global $CFG, $DB; require_once($CFG->dirroot . '/course/lib.php'); $this->resetAfterTest(); + $CFG->enableavailability = 0; // Create a course and some pages: // 0. Invisible due to visible=0. diff --git a/course/tests/externallib_test.php b/course/tests/externallib_test.php index e443b33cd3e..c5a6464edf3 100644 --- a/course/tests/externallib_test.php +++ b/course/tests/externallib_test.php @@ -1041,9 +1041,7 @@ class core_course_externallib_testcase extends externallib_advanced_testcase { $this->assertEquals($course2['forcetheme'], $courseinfo->theme); } - if (completion_info::is_enabled_for_site()) { - $this->assertEquals($course2['enabledcompletion'], $courseinfo->enablecompletion); - } + $this->assertEquals($course2['enablecompletion'], $courseinfo->enablecompletion); } else if ($course['id'] == $course1['id']) { $this->assertEquals($course1['fullname'], $courseinfo->fullname); $this->assertEquals($course1['shortname'], $courseinfo->shortname);