(NFC) Fix cannot use count() on object that doesn't implement countable in tests...
authorSeamus Lee <seamuslee001@gmail.com>
Wed, 16 May 2018 09:46:37 +0000 (19:46 +1000)
committerSeamus Lee <seamuslee001@gmail.com>
Wed, 16 May 2018 09:46:37 +0000 (19:46 +1000)
tests/phpunit/CRM/Contribute/Import/Parser/ContributionTest.php

index 4cae5b79d8f918227794f8d9501d03a8ff9f5cc3..64810f7606d80515e995da514c20286d9615d583 100644 (file)
@@ -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.