From 58f89319f6ad60dc5f12cb76ace8d089c8ff3255 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Wed, 16 May 2018 19:46:37 +1000 Subject: [PATCH] (NFC) Fix cannot use count() on object that doesn't implement countable in tests/phpunit/CRM/Contribute/Import/Parser/ContributionTest.php --- .../CRM/Contribute/Import/Parser/ContributionTest.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/phpunit/CRM/Contribute/Import/Parser/ContributionTest.php b/tests/phpunit/CRM/Contribute/Import/Parser/ContributionTest.php index 4cae5b79d8..64810f7606 100644 --- a/tests/phpunit/CRM/Contribute/Import/Parser/ContributionTest.php +++ b/tests/phpunit/CRM/Contribute/Import/Parser/ContributionTest.php @@ -64,8 +64,10 @@ class CRM_Contribute_Import_Parser_ContributionTest extends CiviUnitTestCase { $params["contact_id"] = $contact2Id; $contributionsOfSoftContact = CRM_Contribute_BAO_ContributionSoft::retrieve($params, $values); - $this->assertEquals(1, count($contributionsOfMainContact), 'Contribution not added for primary contact'); - $this->assertEquals(1, count($contributionsOfSoftContact), 'Soft Contribution not added for secondary contact'); + $this->assertEquals(1, $contributionsOfMainContact->N, 'Contribution not added for primary contact'); + $this->assertEquals(1, $contributionsOfSoftContact->N, 'Soft Contribution not added for secondary contact'); + $this->callAPISuccess('ContributionSoft', 'Delete', ['id' => $contributionsOfSoftContact->id]); + $this->callAPISuccess('Contribution', 'Delete', ['id' => $contributionsOfMainContact->id]); } /** * Run the import parser. -- 2.25.1