/** * @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)); }
protected function _pretend_added_field_onto_registration_model() { add_filter('FHEE__EEM_Registration__construct__fields', array($this, '_add_reg_paid_field')); EEM_Registration::reset(); }