diff --git a/tests/phpunit/CRM/Pledge/BAO/PledgePaymentTest.php b/tests/phpunit/CRM/Pledge/BAO/PledgePaymentTest.php index c02ed2497791..fcc0d3a2ba39 100644 --- a/tests/phpunit/CRM/Pledge/BAO/PledgePaymentTest.php +++ b/tests/phpunit/CRM/Pledge/BAO/PledgePaymentTest.php @@ -527,6 +527,8 @@ public function testCreatePledgePaymentForMultipleInstallments2() { $this->assertEquals(1, $pp['status_id']); } + $this->assertEquals(count($pledgePayments['values']), CRM_Pledge_BAO_Pledge::pledgeHasFinancialTransactions($pledge->id, 2)); + // Cleanup civicrm_api3('Pledge', 'delete', array( 'id' => $pledge->id, diff --git a/tests/phpunit/CRM/Pledge/BAO/PledgeTest.php b/tests/phpunit/CRM/Pledge/BAO/PledgeTest.php index 76e2b29fcd9a..b29ccbce3d1d 100644 --- a/tests/phpunit/CRM/Pledge/BAO/PledgeTest.php +++ b/tests/phpunit/CRM/Pledge/BAO/PledgeTest.php @@ -91,6 +91,8 @@ public function testPledgePaymentStatus() { $this->assertEquals(count($pledgePayment), 1); $payment = array_pop($pledgePayment); + // Assert that we actually have no pledge Payments + $this->assertEquals(0, CRM_Pledge_BAO_Pledge::pledgeHasFinancialTransactions($pledge->id, array_search('Pending', CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name')))); $this->assertEquals($payment['status'], 'Pending'); $this->assertEquals($payment['scheduled_date'], date('Y-m-d 00:00:00', strtotime($scheduledDate))); }