diff --git a/core/model/Versioned.php b/core/model/Versioned.php index 320d2c7af..e683065c4 100755 --- a/core/model/Versioned.php +++ b/core/model/Versioned.php @@ -138,6 +138,14 @@ class Versioned extends DataObjectDecorator { */ private static $archive_tables = array(); + /** + * Called by {@link SapphireTest} when the database is reset. + * @todo Reduce the coupling between this and SapphireTest, somehow. + */ + public static function on_db_reset() { + self::$archive_tables = array(); + } + /** * Create a temporary table mapping each database record to its version on the given date. * This is used by the versioning system to return database content on that date. diff --git a/dev/SapphireTest.php b/dev/SapphireTest.php index c4f3a8e87..97d61f856 100644 --- a/dev/SapphireTest.php +++ b/dev/SapphireTest.php @@ -233,6 +233,10 @@ class SapphireTest extends PHPUnit_Framework_TestCase { // echo "Deleted temp database " . $dbConn->currentDatabase() . "\n"; $dbConn->dropDatabase(); } + + // Todo: it would be good to remove this inappropriate coupling, somehow. + // The versioned class keeps a static cache of information about temporary tables. + Versioned::on_db_reset(); } }