BUGFIX Enforcing creation of temp database in SapphireTest->setUp() to avoid writing to production databases. This check should only kick in for single test case runs, as the temp database connection should be set in a dev/tests/all run after the first db-related test anyway. (see #5034) (from r99342)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102462 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2010-04-12 08:28:06 +00:00
parent a09263e572
commit 43ff00ebd6

View File

@ -111,7 +111,7 @@ class SapphireTest extends PHPUnit_Framework_TestCase {
$fixtureFile = eval("return {$className}::\$fixture_file;");
// Set up fixture
if($fixtureFile || $this->usesDatabase) {
if($fixtureFile || $this->usesDatabase || !self::using_temp_db()) {
if(substr(DB::getConn()->currentDatabase(),0,5) != 'tmpdb') {
//echo "Re-creating temp database... ";
self::create_temp_db();