本文整理匯總了PHP中SapphireTest::resetDBSchema方法的典型用法代碼示例。如果您正苦於以下問題:PHP SapphireTest::resetDBSchema方法的具體用法?PHP SapphireTest::resetDBSchema怎麽用?PHP SapphireTest::resetDBSchema使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類SapphireTest
的用法示例。
在下文中一共展示了SapphireTest::resetDBSchema方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: rand
/**
* @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);
while (!$dbname || $dbConn->databaseExists($dbname)) {
$dbname = 'tmpdb' . rand(1000000, 9999999);
}
$dbConn->selectDatabase($dbname);
$dbConn->createDatabase();
$st = new SapphireTest();
$st->resetDBSchema();
// Reinstate PHPUnit error handling
set_error_handler(array('PHPUnit_Util_ErrorHandler', 'handleError'));
return $dbname;
}
示例2: defined
static function create_temp_db()
{
// Disable PHPUnit error handling
restore_error_handler();
// Create a temporary database
$dbConn = DB::getConn();
$prefix = defined('SS_DATABASE_PREFIX') ? SS_DATABASE_PREFIX : 'ss_';
$dbname = strtolower(sprintf('%stmpdb', $prefix)) . rand(1000000, 9999999);
while (!$dbname || $dbConn->databaseExists($dbname)) {
$dbname = strtolower(sprintf('%stmpdb', $prefix)) . rand(1000000, 9999999);
}
$dbConn->selectDatabase($dbname);
$dbConn->createDatabase();
$st = new SapphireTest();
$st->resetDBSchema();
// Reinstate PHPUnit error handling
set_error_handler(array('PHPUnit_Util_ErrorHandler', 'handleError'));
return $dbname;
}
示例3: rand
/**
* @todo Make this db agnostic
*/
static function create_temp_db()
{
// Create a temporary database
$dbConn = DB::getConn();
$dbname = 'tmpdb' . rand(1000000, 9999999);
while (!$dbname || $dbConn->databaseExists($dbname)) {
$dbname = 'tmpdb' . rand(1000000, 9999999);
}
$dbConn->selectDatabase($dbname);
$dbConn->createDatabase();
$st = new SapphireTest();
$st->resetDBSchema();
return $dbname;
}