From: Eileen McNaughton Date: Sat, 19 Jun 2021 02:07:21 +0000 (+1200) Subject: Fix test to use valid amounts X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=d2b202dad91e5055055480cc977bfda4d9c1449d;p=civicrm-core.git Fix test to use valid amounts This fixes the test so the rates match the appropriate rate for the tax --- diff --git a/tests/phpunit/api/v3/OrderTest.php b/tests/phpunit/api/v3/OrderTest.php index 74f27905ab..9e88aac047 100644 --- a/tests/phpunit/api/v3/OrderTest.php +++ b/tests/phpunit/api/v3/OrderTest.php @@ -566,13 +566,15 @@ class api_v3_OrderTest extends CiviUnitTestCase { * @throws \CRM_Core_Exception */ public function testCreateOrderIfTotalAmountDoesMatchLineItemsAmountsAndTaxSupplied(): void { + $this->enableTaxAndInvoicing(); + $this->createFinancialTypeWithSalesTax(); $params = [ 'contact_id' => $this->_individualId, 'receive_date' => '2018-01-01', - 'total_amount' => 50, + 'total_amount' => 36.75, 'financial_type_id' => $this->_financialTypeId, 'contribution_status_id' => 'Pending', - 'tax_amount' => 15, + 'tax_amount' => 1.75, 'line_items' => [ 0 => [ 'line_item' => [ @@ -584,9 +586,9 @@ class api_v3_OrderTest extends CiviUnitTestCase { 'qty' => 1, 'unit_price' => 35, 'line_total' => 35, - 'financial_type_id' => 1, + 'financial_type_id' => $this->ids['FinancialType']['taxable'], 'entity_table' => 'civicrm_contribution', - 'tax_amount' => 15, + 'tax_amount' => 1.75, ], ], ],