mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
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:
parent
9effc74de3
commit
3e205b632f
@ -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.
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user