From d8bd20072f92df4e9bd7c8709c941364cba6fbd2 Mon Sep 17 00:00:00 2001 From: Pradeep Nayak Date: Mon, 18 Mar 2019 21:32:02 +0000 Subject: [PATCH] added unit test --- tests/phpunit/api/v3/ContributionTest.php | 27 +++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/tests/phpunit/api/v3/ContributionTest.php b/tests/phpunit/api/v3/ContributionTest.php index b6df822f75..9b99b42f9f 100644 --- a/tests/phpunit/api/v3/ContributionTest.php +++ b/tests/phpunit/api/v3/ContributionTest.php @@ -4299,4 +4299,31 @@ class api_v3_ContributionTest extends CiviUnitTestCase { $this->assertEquals(array('invoice_id'), $result['values']['UI_contrib_invoice_id']); } + /** + * Test Repeat Transaction Contribution with Tax amount. + * https://lab.civicrm.org/dev/core/issues/806 + */ + public function testRepeatContributionWithTaxAmount() { + $this->enableTaxAndInvoicing(); + $financialType = $this->callAPISuccess('financial_type', 'create', [ + 'name' => 'Test taxable financial Type', + 'is_reserved' => 0, + 'is_active' => 1, + ]); + $this->relationForFinancialTypeWithFinancialAccount($financialType['id']); + $contribution = $this->setUpRepeatTransaction( + [], + 'single', + [ + 'financial_type_id' => $financialType['id'], + ] + ); + $this->callAPISuccess('contribution', 'repeattransaction', array( + 'original_contribution_id' => $contribution['id'], + 'contribution_status_id' => 'Completed', + 'trxn_id' => uniqid(), + )); + $this->callAPISuccessGetCount('Contribution', [], 2); + } + } -- 2.25.1