From e92b8c430b714dbc104e263f98ce91015e8700ef Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Wed, 26 May 2021 12:35:30 +1200 Subject: [PATCH] Test fixes This improves cleanup in one class & in another makes it accept tax_amount = 0 rather than requiring it to be NULL. In general it's better for us to return and save 0 so this makes the test tolerate those changes --- tests/phpunit/CRM/Contribute/Form/ContributionTest.php | 2 +- tests/phpunit/api/v3/ContributionPageTest.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/phpunit/CRM/Contribute/Form/ContributionTest.php b/tests/phpunit/CRM/Contribute/Form/ContributionTest.php index 9307ea432e..db1d80e842 100644 --- a/tests/phpunit/CRM/Contribute/Form/ContributionTest.php +++ b/tests/phpunit/CRM/Contribute/Form/ContributionTest.php @@ -1141,7 +1141,7 @@ Price Field - Price Field 1 1 $ 100.00 $ 100.00 ] ); $this->assertEquals(100, $contribution['total_amount']); - $this->assertEquals(NULL, $contribution['tax_amount']); + $this->assertEquals(0, (float) $contribution['tax_amount']); $this->callAPISuccessGetCount('FinancialTrxn', [], 1); $this->callAPISuccessGetCount('FinancialItem', [], 1); $lineItem = $this->callAPISuccessGetSingle('LineItem', [ diff --git a/tests/phpunit/api/v3/ContributionPageTest.php b/tests/phpunit/api/v3/ContributionPageTest.php index 33242d3448..38f28ea676 100644 --- a/tests/phpunit/api/v3/ContributionPageTest.php +++ b/tests/phpunit/api/v3/ContributionPageTest.php @@ -89,6 +89,7 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase { foreach ($this->contactIds as $id) { $this->callAPISuccess('contact', 'delete', ['id' => $id]); } + $this->quickCleanup(['civicrm_system_log']); $this->quickCleanUpFinancialEntities(); parent::tearDown(); } -- 2.25.1