本文整理汇总了PHP中EEM_Registration::reset方法的典型用法代码示例。如果您正苦于以下问题:PHP EEM_Registration::reset方法的具体用法?PHP EEM_Registration::reset怎么用?PHP EEM_Registration::reset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EEM_Registration
的用法示例。
在下文中一共展示了EEM_Registration::reset方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test__set_registration_status_from_request_for_multiple_registrations
/**
* @since 4.8.10.rc.10
* @group integration
*/
public function test__set_registration_status_from_request_for_multiple_registrations()
{
//basically the same as the prior test except here we're testing multiple registrations.
$registration_a = $this->factory->registration->create(array('STS_ID' => EEM_Registration::status_id_cancelled));
$registration_b = $this->factory->registration->create(array('STS_ID' => EEM_Registration::status_id_pending_payment));
$registration_c = $this->factory->registration->create(array('STS_ID' => EEM_Registration::status_id_not_approved));
$expected_ids = array($registration_a->ID(), $registration_b->ID(), $registration_c->ID());
$_REQUEST['_REG_ID'] = $expected_ids;
$this->_load_requirements();
$success = $this->_admin_page->set_registration_status_from_request(EEM_Registration::status_id_not_approved);
$this->assertArrayHasKey('success', $success);
$this->assertTrue($success['success']);
$this->assertArrayHasKey('REG_ID', $success);
$this->assertCount(3, $success['REG_ID']);
$this->assertEquals($expected_ids, $success['REG_ID']);
//verify registrations got chagned to approved (or stayed there).
$registrations = EEM_Registration::reset()->instance()->get_all(array(array('STS_ID' => EEM_Registration::status_id_not_approved)));
$this->assertEquals(3, count($registrations));
$this->assertEquals($expected_ids, array_keys($registrations));
}
示例2: _pretend_added_field_onto_registration_model
protected function _pretend_added_field_onto_registration_model()
{
add_filter('FHEE__EEM_Registration__construct__fields', array($this, '_add_reg_paid_field'));
EEM_Registration::reset();
}