本文整理汇总了PHP中FunctionalTest::set_up_once方法的典型用法代码示例。如果您正苦于以下问题:PHP FunctionalTest::set_up_once方法的具体用法?PHP FunctionalTest::set_up_once怎么用?PHP FunctionalTest::set_up_once使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FunctionalTest
的用法示例。
在下文中一共展示了FunctionalTest::set_up_once方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
static function set_up_once() {
self::$orig['CMSBatchActionHandler_batch_actions'] = CMSBatchActionHandler::$batch_actions;
CMSBatchActionHandler::$batch_actions = array(
'publish' => 'CMSBatchAction_Publish',
'delete' => 'CMSBatchAction_Delete',
'deletefromlive' => 'CMSBatchAction_DeleteFromLive',
);
parent::set_up_once();
}
示例2: singleton
static function set_up_once()
{
// needs to recreate the database schema with language properties
self::kill_temp_db();
// store old defaults
self::$origTranslatableSettings['has_extension'] = singleton('SiteTree')->hasExtension('Translatable');
self::$origTranslatableSettings['default_locale'] = Translatable::default_locale();
// overwrite locale
Translatable::set_default_locale("en_US");
// refresh the decorated statics - different fields in $db with Translatable enabled
if (!self::$origTranslatableSettings['has_extension']) {
Object::add_extension('SiteTree', 'Translatable');
}
Object::add_extension('TranslatableTest_DataObject', 'Translatable');
// clear singletons, they're caching old extension info which is used in DatabaseAdmin->doBuild()
global $_SINGLETONS;
$_SINGLETONS = array();
// recreate database with new settings
$dbname = self::create_temp_db();
DB::set_alternative_database_name($dbname);
parent::set_up_once();
}
示例3:
static function set_up_once() {
SiteTreeTest::set_up_once();
parent::set_up_once();
}