BUGFIX SapphireTest::create_temp_db() should restore the SS error handler from the PHPUnit one temporarily in case there's any errors building

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@108509 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2010-07-26 05:56:33 +00:00 committed by Sam Minnee
parent 375696a964
commit 6671b03ecf

View File

@ -642,6 +642,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);
@ -655,6 +658,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;
}