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
This commit is contained in:
Sam Minnee 2010-10-19 00:42:53 +00:00
parent d28d7510af
commit b2c7c944de

View File

@ -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;
}