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 (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:
parent
d28d7510af
commit
b2c7c944de
@ -650,6 +650,9 @@ class SapphireTest extends PHPUnit_Framework_TestCase {
|
|||||||
* @todo Make this db agnostic
|
* @todo Make this db agnostic
|
||||||
*/
|
*/
|
||||||
static function create_temp_db() {
|
static function create_temp_db() {
|
||||||
|
// Disable PHPUnit error handling
|
||||||
|
restore_error_handler();
|
||||||
|
|
||||||
// Create a temporary database
|
// Create a temporary database
|
||||||
$dbConn = DB::getConn();
|
$dbConn = DB::getConn();
|
||||||
$dbname = 'tmpdb' . rand(1000000,9999999);
|
$dbname = 'tmpdb' . rand(1000000,9999999);
|
||||||
@ -663,6 +666,9 @@ class SapphireTest extends PHPUnit_Framework_TestCase {
|
|||||||
$st = new SapphireTest();
|
$st = new SapphireTest();
|
||||||
$st->resetDBSchema();
|
$st->resetDBSchema();
|
||||||
|
|
||||||
|
// Reinstate PHPUnit error handling
|
||||||
|
set_error_handler(array('PHPUnit_Util_ErrorHandler', 'handleError'));
|
||||||
|
|
||||||
return $dbname;
|
return $dbname;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user