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:
Andrew Nicols
2014-10-30 12:02:35 +08:00
parent eb451c7981
commit a54702b234
2 changed files with 6 additions and 0 deletions
+1
View File
@@ -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');
+5
View File
@@ -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();
}
/**