Remove deprecated test-only function
authorEileen McNaughton <emcnaughton@wikimedia.org>
Thu, 21 Dec 2023 21:13:20 +0000 (10:13 +1300)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Thu, 21 Dec 2023 21:13:20 +0000 (10:13 +1300)
CRM/Event/Form/Registration/Confirm.php

index 75f4701601d69ae84cf78d2c8368a0cf911b1752..e6e0cb1ddf6839cb19c811332975ee2f21da1fe4 100644 (file)
@@ -1192,41 +1192,6 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration {
     }
   }
 
-  /**
-   * Submit in test mode.
-   *
-   * Do not use this - we have figured out how to emulate form in tests now.
-   *
-   * See ConfirmTest.
-   *
-   * @deprecated
-   *
-   * @param $params
-   */
-  public static function testSubmit($params) {
-    CRM_Core_Error::deprecatedFunctionWarning('use the Civi\Test\FormTrait');
-    $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'];
-    // This happens in buildQuickForm so emulate here.
-    $form->_amount = $form->_totalAmount = $params['totalAmount'] ?? 0;
-    $form->set('params', $params['params']);
-    $form->_values['custom_pre_id'] = $params['custom_pre_id'] ?? NULL;
-    $form->_values['custom_post_id'] = $params['custom_post_id'] ?? NULL;
-    $form->_values['event'] = $params['event'] ?? NULL;
-    $eventParams = ['id' => $params['id']];
-    CRM_Event_BAO_Event::retrieve($eventParams, $form->_values['event']);
-    $form->set('registerByID', $params['registerByID']);
-    if (!empty($params['paymentProcessorObj'])) {
-      $form->_paymentProcessor = $params['paymentProcessorObj'];
-    }
-    $form->postProcess();
-    return $form;
-  }
-
   /**
    * Process the payment, redirecting back to the page on error.
    *