From bd622d2ebb1f694051408fd7d487723a6467dccb Mon Sep 17 00:00:00 2001 From: Pradeep Nayak Date: Mon, 19 Nov 2018 00:45:30 +0530 Subject: [PATCH] Modified unit test --- tests/phpunit/CRM/Batch/BAO/BatchTest.php | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/tests/phpunit/CRM/Batch/BAO/BatchTest.php b/tests/phpunit/CRM/Batch/BAO/BatchTest.php index f099889aa2..7a9631ac93 100644 --- a/tests/phpunit/CRM/Batch/BAO/BatchTest.php +++ b/tests/phpunit/CRM/Batch/BAO/BatchTest.php @@ -51,9 +51,9 @@ class CRM_Batch_BAO_BatchTest extends CiviUnitTestCase { $this->contributionCreate([ 'contact_id' => $contactId, 'total_amount' => 1, - 'payment_instrument_id' => CRM_Core_PseudoConstant::getKey('CRM_Contribute_BAO_Contribution', 'payment_instrument_id', 'Check'), - 'financial_type_id' => 1, - 'contribution_status_id' => 1, + 'payment_instrument_id' => 'Check', + 'financial_type_id' => 'Donation', + 'contribution_status_id' => 'Completed', 'receive_date' => '20080522000000', 'receipt_date' => '20080522000000', 'trxn_id' => '22ereerwww322323', @@ -67,9 +67,9 @@ class CRM_Batch_BAO_BatchTest extends CiviUnitTestCase { $this->contributionCreate([ 'contact_id' => $contactId, 'total_amount' => 1, - 'payment_instrument_id' => CRM_Core_PseudoConstant::getKey('CRM_Contribute_BAO_Contribution', 'payment_instrument_id', 'Credit Card'), - 'financial_type_id' => 1, - 'contribution_status_id' => 1, + 'payment_instrument_id' => 'Credit Card', + 'financial_type_id' => 'Member Dues', + 'contribution_status_id' => 'Completed', 'receive_date' => '20080523000000', 'receipt_date' => '20080523000000', 'trxn_id' => '22ereerwww323323', @@ -96,7 +96,12 @@ class CRM_Batch_BAO_BatchTest extends CiviUnitTestCase { $result = CRM_Batch_BAO_Batch::getBatchFinancialItems($entityId, $returnvalues, $notPresent, $params, TRUE)->fetchAll(); $this->assertEquals(count($result), 1, 'In line' . __LINE__); $this->assertEquals($result[0]['payment_method'], CRM_Core_PseudoConstant::getKey('CRM_Contribute_BAO_Contribution', 'payment_instrument_id', 'Check'), 'In line' . __LINE__); - + $params['financial_type_id'] = implode(',', [ + CRM_Core_PseudoConstant::getKey('CRM_Contribute_BAO_Contribution', 'financial_type_id', 'Donation'), + CRM_Core_PseudoConstant::getKey('CRM_Contribute_BAO_Contribution', 'financial_type_id', 'Member Dues'), + ]); + $result = CRM_Batch_BAO_Batch::getBatchFinancialItems($entityId, $returnvalues, $notPresent, $params, TRUE)->fetchAll(); + $this->assertEquals(count($result), 1, 'In line' . __LINE__); } } -- 2.25.1