Take a reality check on moneyCleaning in test
authorEileen McNaughton <emcnaughton@wikimedia.org>
Fri, 15 Apr 2022 02:11:43 +0000 (14:11 +1200)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Fri, 15 Apr 2022 02:11:43 +0000 (14:11 +1200)
CRM/Event/Form/Registration/Confirm.php
tests/phpunit/CRM/Event/Form/Registration/ConfirmTest.php

index ce672ee1ad57b7ddcc81a19481bc6e979342e934..fe1c69fe4435a21758dd4eeea8ada295a845a752 100644 (file)
@@ -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;
index 9503d80789c19629a724a73b3a2954c0eec624b9..25d0251b9ebba902a89bea5fa4eb66ff23247e79 100644 (file)
@@ -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',