mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Merge pull request #5573 from dhensby/pulls/3.1/fix-no-db-tests
FIX #5557 Tests with no DB requirements wont create test DB
This commit is contained in:
commit
4e6d0b3982
@ -223,13 +223,9 @@ class SapphireTest extends PHPUnit_Framework_TestCase {
|
||||
$this->model = DataModel::inst();
|
||||
|
||||
// Set up fixture
|
||||
if($fixtureFile || $this->usesDatabase || !self::using_temp_db()) {
|
||||
if(substr(DB::getConn()->currentDatabase(), 0, strlen($prefix) + 5)
|
||||
!= strtolower(sprintf('%stmpdb', $prefix))) {
|
||||
|
||||
//echo "Re-creating temp database... ";
|
||||
if($fixtureFile || $this->usesDatabase) {
|
||||
if (!self::using_temp_db()) {
|
||||
self::create_temp_db();
|
||||
//echo "done.\n";
|
||||
}
|
||||
|
||||
singleton('DataObject')->flushCache();
|
||||
|
Loading…
x
Reference in New Issue
Block a user