Skip to content

Commit

Permalink
MDL-63522 course: Restore config and static cache
Browse files Browse the repository at this point in the history
  • Loading branch information
jleyva committed Oct 30, 2018
1 parent 1de5136 commit 716c103
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion course/tests/externallib_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,6 @@ private function prepare_get_course_contents_test() {

$CFG->allowstealth = 1; // Allow stealth activities.
$CFG->enablecompletion = true;
$CFG->forum_allowforcedreadtracking = 1;
$course = self::getDataGenerator()->create_course(['numsections' => 4, 'enablecompletion' => 1]);

$forumdescription = 'This is the forum description';
Expand Down Expand Up @@ -882,8 +881,10 @@ private function prepare_get_course_contents_test() {
* Test get_course_contents
*/
public function test_get_course_contents() {
global $CFG;
$this->resetAfterTest(true);

$CFG->forum_allowforcedreadtracking = 1;
list($course, $forumcm, $datacm, $pagecm, $labelcm, $urlcm) = $this->prepare_get_course_contents_test();

// We first run the test as admin.
Expand Down Expand Up @@ -922,6 +923,9 @@ public function test_get_course_contents() {
}
}

$CFG->forum_allowforcedreadtracking = 0; // Recover original value.
forum_tp_count_forum_unread_posts($forumcm, $course, true); // Reset static cache for further tests.

$this->assertEquals(5, $testexecuted);
$this->assertEquals(0, $sections[0]['section']);

Expand Down

0 comments on commit 716c103

Please sign in to comment.