]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-21015 enable xmldb_structures cache for UnitTestCaseUsingDatabase.
authorEloy Lafuente <stronk7@moodle.org>
Tue, 1 Dec 2009 18:30:21 +0000 (18:30 +0000)
committerEloy Lafuente <stronk7@moodle.org>
Tue, 1 Dec 2009 18:30:21 +0000 (18:30 +0000)
Example: Yay, grade tests 40 mins down to 50 secs!

lib/simpletestlib.php

index 29412f4a3e68cd7fa222ccdbb7278ec06506e4d5..0be971c7b9d2725b79ffa13b9349f40ee7ff7853 100644 (file)
@@ -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;
     }