From: colemanw Date: Sun, 26 Feb 2023 02:40:17 +0000 (-0500) Subject: Merge pull request #25621 from eileenmcnaughton/event_test_cleanup X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=6b4dff9e0dd1ff3edc13c9cacdb10780f51b92de;p=civicrm-core.git Merge pull request #25621 from eileenmcnaughton/event_test_cleanup Event test cleanup, fix test to use submitted form values, rather than require a lot of contorting --- 6b4dff9e0dd1ff3edc13c9cacdb10780f51b92de diff --cc tests/phpunit/CiviTest/CiviUnitTestCase.php index 2514335366,8508ee2aea..ae87412c1d --- a/tests/phpunit/CiviTest/CiviUnitTestCase.php +++ b/tests/phpunit/CiviTest/CiviUnitTestCase.php @@@ -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':