MDL-47903 mod_forum: Correct test fails related to caching and time
This adds a reset of the discussion and forum cache when running the mail and maildigest tests. These test fails were highlighted by the addition of new tests which add similar post ids.
This commit is contained in:
@@ -35,6 +35,7 @@ class mod_forum_mail_testcase extends advanced_testcase {
|
||||
// We must clear the subscription caches. This has to be done both before each test, and after in case of other
|
||||
// tests using these functions.
|
||||
\mod_forum\subscriptions::reset_forum_cache();
|
||||
\mod_forum\subscriptions::reset_discussion_cache();
|
||||
|
||||
global $CFG;
|
||||
require_once($CFG->dirroot . '/mod/forum/lib.php');
|
||||
|
||||
@@ -74,6 +74,11 @@ class mod_forum_maildigest_testcase extends advanced_testcase {
|
||||
|
||||
// Ensure that we don't prevent e-mail as this will cause unit test failures.
|
||||
$CFG->noemailever = false;
|
||||
|
||||
// We must clear the subscription caches. This has to be done both before each test, and after in case of other
|
||||
// tests using these functions.
|
||||
\mod_forum\subscriptions::reset_forum_cache();
|
||||
\mod_forum\subscriptions::reset_discussion_cache();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user