MDL-35714 run gc before test reset

This commit is contained in:
Petr Škoda 2012-10-02 13:35:32 +02:00
parent 562dbe408e
commit 2104c9fdc3

View file

@ -544,6 +544,9 @@ class phpunit_util {
public static function reset_all_data($logchanges = false) { public static function reset_all_data($logchanges = false) {
global $DB, $CFG, $USER, $SITE, $COURSE, $PAGE, $OUTPUT, $SESSION, $GROUPLIB_CACHE; global $DB, $CFG, $USER, $SITE, $COURSE, $PAGE, $OUTPUT, $SESSION, $GROUPLIB_CACHE;
// Release memory and indirectly call destroy() methods to release resource handles, etc.
gc_collect_cycles();
// reset global $DB in case somebody mocked it // reset global $DB in case somebody mocked it
$DB = self::get_global_backup('DB'); $DB = self::get_global_backup('DB');