From a7b9128b7b06e09a2013c2cbc17ee5e7fa8a18a1 Mon Sep 17 00:00:00 2001 From: eileen Date: Sat, 16 Feb 2019 09:40:54 +1300 Subject: [PATCH] Add thousandseparator variant to test --- CRM/Financial/BAO/Payment.php | 3 --- tests/phpunit/api/v3/PaymentTest.php | 16 ++++++++++++---- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/CRM/Financial/BAO/Payment.php b/CRM/Financial/BAO/Payment.php index b9b287b7ec..6c6aaed7ce 100644 --- a/CRM/Financial/BAO/Payment.php +++ b/CRM/Financial/BAO/Payment.php @@ -264,9 +264,6 @@ class CRM_Financial_BAO_Payment { ]; // Need to do these before switching the form over... $todoParams = [ - - - 'paymentsComplete', 'contributeMode', 'billingName', diff --git a/tests/phpunit/api/v3/PaymentTest.php b/tests/phpunit/api/v3/PaymentTest.php index d28231cae5..1d43cf6186 100644 --- a/tests/phpunit/api/v3/PaymentTest.php +++ b/tests/phpunit/api/v3/PaymentTest.php @@ -144,12 +144,19 @@ class api_v3_PaymentTest extends CiviUnitTestCase { 'streety street', )); $mut->stop(); + $mut->clearMessages(); } /** * Test email receipt for partial payment. + * + * @dataProvider getThousandSeparators + * + * @param string $thousandSeparator */ - public function testRefundEmailReceipt() { + public function testRefundEmailReceipt($thousandSeparator) { + $this->setCurrencySeparators($thousandSeparator); + $decimalSeparator = ($thousandSeparator === ',' ? '.' : ','); $mut = new CiviMailUtils($this); list($lineItems, $contribution) = $this->createParticipantWithContribution(); $this->callAPISuccess('payment', 'create', [ @@ -179,14 +186,15 @@ class api_v3_PaymentTest extends CiviUnitTestCase { $mut->assertSubjects(['Refund Notification - Annual CiviCRM meet']); $mut->checkMailLog(array( 'Dear Mr. Anthony Anderson II', - 'Total Fees: $ 300.00', - 'Refund Amount: $ -30.00', + 'Total Fees: $ 300' . $decimalSeparator . '00', + 'Refund Amount: $ -30' . $decimalSeparator . '00', 'Event Information and Location', 'Paid By: Check', 'Transaction Date: November 13th, 2018 12:01 PM', - 'You Paid: $ 170.00', + 'You Paid: $ 170' . $decimalSeparator . '00', )); $mut->stop(); + $mut->clearMessages(); } /** -- 2.25.1