From: Seamus Lee Date: Wed, 16 May 2018 09:46:37 +0000 (+1000) Subject: (NFC) Fix cannot use count() on object that doesn't implement countable in tests... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=58f89319f6ad60dc5f12cb76ace8d089c8ff3255;p=civicrm-core.git (NFC) Fix cannot use count() on object that doesn't implement countable in tests/phpunit/CRM/Contribute/Import/Parser/ContributionTest.php --- 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.