mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
parent
375696a964
commit
6671b03ecf
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user