mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
parent
a09263e572
commit
43ff00ebd6
@ -111,7 +111,7 @@ class SapphireTest extends PHPUnit_Framework_TestCase {
|
|||||||
$fixtureFile = eval("return {$className}::\$fixture_file;");
|
$fixtureFile = eval("return {$className}::\$fixture_file;");
|
||||||
|
|
||||||
// Set up fixture
|
// Set up fixture
|
||||||
if($fixtureFile || $this->usesDatabase) {
|
if($fixtureFile || $this->usesDatabase || !self::using_temp_db()) {
|
||||||
if(substr(DB::getConn()->currentDatabase(),0,5) != 'tmpdb') {
|
if(substr(DB::getConn()->currentDatabase(),0,5) != 'tmpdb') {
|
||||||
//echo "Re-creating temp database... ";
|
//echo "Re-creating temp database... ";
|
||||||
self::create_temp_db();
|
self::create_temp_db();
|
||||||
|
Loading…
Reference in New Issue
Block a user