本文整理汇总了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;
}