From: deb.monish Date: Thu, 19 May 2016 10:56:01 +0000 (+0530) Subject: CRM-17123: add unit test X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=dfedc5768699a79e04d7aa7dcdd2e6d22b8d45b8;p=civicrm-core.git CRM-17123: add unit test --- diff --git a/tests/phpunit/CRM/Batch/Form/EntryTest.php b/tests/phpunit/CRM/Batch/Form/EntryTest.php index f93ae000b1..ad5e4c696e 100644 --- a/tests/phpunit/CRM/Batch/Form/EntryTest.php +++ b/tests/phpunit/CRM/Batch/Form/EntryTest.php @@ -174,14 +174,15 @@ class CRM_Batch_Form_EntryTest extends CiviUnitTestCase { $this->assertEquals(date('Y-m-d', strtotime('07/22/2013')), $result['values'][1]['join_date']); $this->assertEquals(date('Y-m-d', strtotime('07/03/2013')), $result['values'][2]['join_date']); $this->assertEquals(date('Y-m-d', strtotime('now')), $result['values'][3]['join_date']); - $result = $this->callAPISuccess('contribution', 'get', array('return' => 'total_amount')); + $result = $this->callAPISuccess('contribution', 'get', array('return' => array('total_amount', 'trxn_id'))); $this->assertEquals(3, $result['count']); - foreach ($result['values'] as $contribution) { + foreach ($result['values'] as $key => $contribution) { $this->assertEquals($this->callAPISuccess('line_item', 'getvalue', array( 'contribution_id' => $contribution['id'], 'return' => 'line_total', )), $contribution['total_amount']); + $this->assertEquals($params['field'][$key]['trxn_id'], $contribution['trxn_id']); } } @@ -274,6 +275,7 @@ class CRM_Batch_Form_EntryTest extends CiviUnitTestCase { 'receive_date' => '07/24/2013', 'receive_date_time' => NULL, 'payment_instrument' => 1, + 'trxn_id' => 'TX101', 'check_number' => NULL, 'contribution_status_id' => 1, ), @@ -288,6 +290,7 @@ class CRM_Batch_Form_EntryTest extends CiviUnitTestCase { 'receive_date' => '07/17/2013', 'receive_date_time' => NULL, 'payment_instrument' => NULL, + 'trxn_id' => 'TX102', 'check_number' => NULL, 'contribution_status_id' => 1, ), @@ -303,6 +306,7 @@ class CRM_Batch_Form_EntryTest extends CiviUnitTestCase { 'receive_date' => '07/17/2013', 'receive_date_time' => NULL, 'payment_instrument' => NULL, + 'trxn_id' => 'TX103', 'check_number' => NULL, 'contribution_status_id' => 1, ),