Merge pull request #25621 from eileenmcnaughton/event_test_cleanup
authorcolemanw <coleman@civicrm.org>
Sun, 26 Feb 2023 02:40:17 +0000 (21:40 -0500)
committerGitHub <noreply@github.com>
Sun, 26 Feb 2023 02:40:17 +0000 (21:40 -0500)
Event test cleanup, fix test to use submitted form values, rather than require a lot of contorting

1  2 
tests/phpunit/CRMTraits/Financial/PriceSetTrait.php
tests/phpunit/CiviTest/CiviUnitTestCase.php

index 251433536672a6f906a222aa6cddc0882355d9aa,8508ee2aea4e5c50ec16ab993db35bdc5fdd8d95..ae87412c1d09fdbd17fdf13f2ca57cb0d1d2ed21
@@@ -3150,17 -3156,21 +3162,28 @@@ class CiviUnitTestCase extends PHPUnit\
          $form->controller = new CRM_Event_Cart_Controller_Checkout();
          break;
  
+       case 'CRM_Event_Form_Registration_Register':
+         $form->controller = $this->formController = new CRM_Event_Controller_Registration();
+         break;
        case 'CRM_Event_Form_Registration_Confirm':
-         $form->controller = new CRM_Event_Controller_Registration();
+       case 'CRM_Event_Form_Registration_AdditionalParticipant':
+         if ($this->formController) {
+           // Add to the existing form controller.
+           $form->controller = $this->formController;
+         }
+         else {
+           $form->controller = $this->formController = new CRM_Event_Controller_Registration();
+         }
          break;
  
 +      case 'CRM_Contribute_Form_Contribution_Confirm':
 +        $form->controller = new CRM_Contribute_Controller_Contribution();
 +        $form->controller->setStateMachine(new CRM_Contribute_StateMachine_Contribution($form->controller));
 +        // The submitted values are on the Main form.
 +        $_SESSION['_' . $form->controller->_name . '_container']['values']['Main'] = $formValues;
 +        return $form;
 +
        case 'CRM_Contact_Import_Form_DataSource':
        case 'CRM_Contact_Import_Form_MapField':
        case 'CRM_Contact_Import_Form_Preview':