+ /**
+ * Submit in test mode.
+ *
+ * @param $params
+ */
+ public static function testSubmit($params) {
+ $form = new CRM_Event_Form_Registration_Confirm();
+ // This way the mocked up controller ignores the session stuff.
+ $_SERVER['REQUEST_METHOD'] = 'GET';
+ $_REQUEST['id'] = $form->_eventId = $params['id'];
+ $form->controller = new CRM_Event_Controller_Registration();
+ $form->_params = $params['params'];
+ $form->set('params', $params['params']);
+ $form->_values['custom_pre_id'] = array();
+ $form->_values['custom_post_id'] = array();
+ $form->_contributeMode = $params['contributeMode'];
+ $eventParams = array('id' => $params['id']);
+ CRM_Event_BAO_Event::retrieve($eventParams, $form->_values['event']);
+ $form->set('registerByID', $params['registerByID']);
+ $form->postProcess();
+ }
+