From: Eileen McNaughton Date: Fri, 15 Apr 2022 02:11:43 +0000 (+1200) Subject: Take a reality check on moneyCleaning in test X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=b2dc39fc4e99f6ffb5ed973a3ee835c5a1080d2a;p=civicrm-core.git Take a reality check on moneyCleaning in test --- diff --git a/CRM/Event/Form/Registration/Confirm.php b/CRM/Event/Form/Registration/Confirm.php index ce672ee1ad..fe1c69fe44 100644 --- a/CRM/Event/Form/Registration/Confirm.php +++ b/CRM/Event/Form/Registration/Confirm.php @@ -1241,7 +1241,7 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration { $form->controller = new CRM_Event_Controller_Registration(); $form->_params = $params['params']; // This happens in buildQuickForm so emulate here. - $form->_amount = $form->_totalAmount = CRM_Utils_Rule::cleanMoney(CRM_Utils_Array::value('totalAmount', $params)); + $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; diff --git a/tests/phpunit/CRM/Event/Form/Registration/ConfirmTest.php b/tests/phpunit/CRM/Event/Form/Registration/ConfirmTest.php index 9503d80789..25d0251b9e 100644 --- a/tests/phpunit/CRM/Event/Form/Registration/ConfirmTest.php +++ b/tests/phpunit/CRM/Event/Form/Registration/ConfirmTest.php @@ -110,7 +110,7 @@ class CRM_Event_Form_Registration_ConfirmTest extends CiviUnitTestCase { 'contributeMode' => 'direct', 'registerByID' => $individualID, 'paymentProcessorObj' => CRM_Financial_BAO_PaymentProcessor::getPayment($paymentProcessorID), - 'totalAmount' => $this->formatMoneyInput(8000.67), + 'totalAmount' => 8000.67, 'params' => [ [ 'qfKey' => 'e6eb2903eae63d4c5c6cc70bfdda8741_2801',