Skip to content
Snippets Groups Projects
Commit 51258c34 authored by Seamus Lee's avatar Seamus Lee
Browse files

#627 Extend a unit test to verify fix made by Sunil

Add in additional test for when no transactions have occured
parent 1db1a432
No related branches found
No related tags found
No related merge requests found
......@@ -527,6 +527,8 @@ class CRM_Pledge_BAO_PledgePaymentTest extends CiviUnitTestCase {
$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,
......
......@@ -91,6 +91,8 @@ class CRM_Pledge_BAO_PledgeTest extends CiviUnitTestCase {
$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)));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment