From 83826850346bc486bc4599dca56067897961cbfa Mon Sep 17 00:00:00 2001 From: Daniel Hensby Date: Fri, 20 May 2016 15:37:52 +0100 Subject: [PATCH] FIX #5557 Tests with no DB requirements wont create test DB --- dev/SapphireTest.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/dev/SapphireTest.php b/dev/SapphireTest.php index af3d829f9..0964019c3 100644 --- a/dev/SapphireTest.php +++ b/dev/SapphireTest.php @@ -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();