BUGFIX: Added Versioned::on_db_reset() so that Versioned tests would run properly.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@77568 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2009-05-21 08:08:01 +00:00
parent 9effc74de3
commit 3e205b632f
2 changed files with 12 additions and 0 deletions

View File

@ -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.

View File

@ -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();
}
}