/**
  * Called by {@link SapphireTest} when the database is reset.
  * @todo Reduce the coupling between this and SapphireTest, somehow.
  */
 public static function on_db_reset()
 {
     // Drop all temporary tables
     $db = DB::getConn();
     if ($db->isActive()) {
         foreach (self::$temp_tables as $tableName) {
             if (method_exists($db, 'dropTable')) {
                 $db->dropTable($tableName);
             } else {
                 $db->query("DROP TABLE \"{$tableName}\"");
             }
         }
     }
     // Remove references to them
     self::$temp_tables = array();
 }