mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00: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)
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:
parent
ea665cd45e
commit
7a6da70076
@ -110,7 +110,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) {
|
if($fixtureFile || !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…
x
Reference in New Issue
Block a user