First, after restoring the old schema it needs to clear the variable so
it doesn't keep "restoring" again and again for every subsequent test
class.
Second, after restoring the old schema it needs to repopulate anything
added by addCoreDBData() that was lost by dropping and recreating the
affected tables, which is easiest done by calling $this->resetDB().
Change-Id: I549d10eb7ceec117d3a0138449ca01f8065707d4
if ( $tablesToRestore ) {
$this->recloneMockTables( $db, $tablesToRestore );
+
+ // Reset the restored tables, mainly for the side effect of
+ // re-calling $this->addCoreDBData() if necessary.
+ $this->resetDB( $db, $tablesToRestore );
}
}
if ( $oldOverrides['alter'] || $oldOverrides['create'] || $oldOverrides['drop'] ) {
$this->undoSchemaOverrides( $db, $oldOverrides );
+ unset( $db->_schemaOverrides );
}
// Determine new overrides.