From b2c7c944deea46c0af98055c452cfbb4ad6232f8 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Tue, 19 Oct 2010 00:42:53 +0000 Subject: [PATCH] BUGFIX SapphireTest::create_temp_db() should restore the SS error handler from the PHPUnit one temporarily in case there's any errors building (from r108509) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112755 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- dev/SapphireTest.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dev/SapphireTest.php b/dev/SapphireTest.php index 64220c3af..50abafe23 100755 --- a/dev/SapphireTest.php +++ b/dev/SapphireTest.php @@ -650,6 +650,9 @@ class SapphireTest extends PHPUnit_Framework_TestCase { * @todo Make this db agnostic */ static function create_temp_db() { + // Disable PHPUnit error handling + restore_error_handler(); + // Create a temporary database $dbConn = DB::getConn(); $dbname = 'tmpdb' . rand(1000000,9999999); @@ -663,6 +666,9 @@ class SapphireTest extends PHPUnit_Framework_TestCase { $st = new SapphireTest(); $st->resetDBSchema(); + // Reinstate PHPUnit error handling + set_error_handler(array('PHPUnit_Util_ErrorHandler', 'handleError')); + return $dbname; }