From: Eloy Lafuente Date: Tue, 1 Dec 2009 18:30:21 +0000 (+0000) Subject: MDL-21015 enable xmldb_structures cache for UnitTestCaseUsingDatabase. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=c6adec25bbbc74a994e52bc77e6a8ceb9dee12b8;p=moodle.git MDL-21015 enable xmldb_structures cache for UnitTestCaseUsingDatabase. Example: Yay, grade tests 40 mins down to 50 secs! --- diff --git a/lib/simpletestlib.php b/lib/simpletestlib.php index 29412f4a3e..0be971c7b9 100644 --- a/lib/simpletestlib.php +++ b/lib/simpletestlib.php @@ -552,7 +552,7 @@ class UnitTestCaseUsingDatabase extends UnitTestCase { debugging('This table ' . $tablename . ' already exists from a previous execution. If the error persists you will need to review your code to ensure it is being created only once.', DEBUG_DEVELOPER); $dbman->drop_table(new xmldb_table($tablename)); } - $dbman->install_one_table_from_xmldb_file($CFG->dirroot . '/' . $installxmlfile . '/db/install.xml', $tablename); + $dbman->install_one_table_from_xmldb_file($CFG->dirroot . '/' . $installxmlfile . '/db/install.xml', $tablename, true); // with structure cache enabled! $this->tables[$tablename] = 1; }