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)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@99342 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2010-02-16 22:46:58 +00:00 committed by Sam Minnee
parent ea665cd45e
commit 7a6da70076

View File

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