本文整理汇总了PHP中EE_Registry::reset方法的典型用法代码示例。如果您正苦于以下问题:PHP EE_Registry::reset方法的具体用法?PHP EE_Registry::reset怎么用?PHP EE_Registry::reset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EE_Registry
的用法示例。
在下文中一共展示了EE_Registry::reset方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
public function setUp()
{
//save the hooks state before WP_UnitTestCase actually gets its hands on it...
//as it immediately adds a few hooks we might not want to backup
global $auto_made_thing_seed, $wp_filter, $wp_actions, $merged_filters, $wp_current_filter, $wpdb, $current_user;
$this->wp_filters_saved = array('wp_filter' => $wp_filter, 'wp_actions' => $wp_actions, 'merged_filters' => $merged_filters, 'wp_current_filter' => $wp_current_filter);
$this->_orig_current_user = clone $current_user;
parent::setUp();
EE_Registry::reset(TRUE);
$auto_made_thing_seed = 1;
//reset wpdb's list of queries executed so it only stores those from the current test
$wpdb->queries = array();
//the accidental txn commit indicator option shouldn't be set from the previous test
update_option('accidental_txn_commit_indicator', TRUE);
// $this->wp_actions_saved = $wp_actions;
// Fake WP mail globals, to avoid errors
add_filter('wp_mail', array($this, 'setUp_wp_mail'));
add_filter('wp_mail_from', array($this, 'tearDown_wp_mail'));
add_filter('FHEE__EEH_Activation__create_table__short_circuit', '__return_true');
add_filter('FHEE__EEH_Activation__add_column_if_it_doesnt_exist__short_circuit', '__return_true');
add_filter('FHEE__EEH_Activation__drop_index__short_circuit', '__return_true');
// load factories
EEH_Autoloader::register_autoloaders_for_each_file_in_folder(EE_TESTS_DIR . 'includes' . DS . 'factories');
$this->factory = new EE_UnitTest_Factory();
// load scenarios
require_once EE_TESTS_DIR . 'includes/scenarios/EE_Test_Scenario_Classes.php';
$this->scenarios = new EE_Test_Scenario_Factory($this);
EE_Registry::reset();
}
示例2: test_default_reg_status
/**
* @see https://events.codebasehq.com/projects/event-espresso/tickets/8799
* @group 8799
* @since 4.8.8.rc.019
*/
public function test_default_reg_status()
{
//first verify the default reg status on config is pending payment
$this->assertEquals(EEM_Registration::status_id_pending_payment, EE_Registry::instance()->CFG->registration->default_STS_ID);
//verify creating default event from the model has that default reg status
/** @type EE_Event $event */
$event = EEM_Event::instance()->create_default_object();
$this->assertEquals(EEM_Registration::status_id_pending_payment, $event->default_registration_status());
//let's update config in the db to have default reg status of approved
EE_Registry::instance()->CFG->registration->default_STS_ID = EEM_Registration::status_id_approved;
EE_Registry::instance()->CFG->update_espresso_config();
//let's reset for new test
EEM_Event::reset();
EE_Registry::reset();
//k NOW the default reg status in config should be approved
$this->assertEquals(EEM_Registration::status_id_approved, EE_Registry::instance()->CFG->registration->default_STS_ID);
//new default event should have approved as the default reg status
$event = EEM_Event::instance()->create_default_object();
$this->assertEquals(EEM_Registration::status_id_approved, $event->default_registration_status());
}