From 6d8785b974d4207da0c6f31b54b26aad86005562 Mon Sep 17 00:00:00 2001 From: Jitendra Purohit Date: Sun, 31 Mar 2019 21:31:45 +0530 Subject: [PATCH] Fix unit test --- CRM/Core/Payment/PayPalProIPN.php | 3 ++- tests/phpunit/CRM/Core/Payment/PayPalProIPNTest.php | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CRM/Core/Payment/PayPalProIPN.php b/CRM/Core/Payment/PayPalProIPN.php index f93bac71d5..9fd23b8d5e 100644 --- a/CRM/Core/Payment/PayPalProIPN.php +++ b/CRM/Core/Payment/PayPalProIPN.php @@ -557,7 +557,8 @@ INNER JOIN civicrm_membership_payment mp ON m.id = mp.membership_id AND mp.contr $objects = $ids = $input = array(); $isFirst = FALSE; $input['invoice'] = self::getValue('i', FALSE); - if (empty($input['invoice'])) { + //Avoid return in case of unit test. + if (empty($input['invoice']) && empty($this->_inputParameters['is_unit_test'])) { return; } $input['txnType'] = $this->retrieve('txn_type', 'String'); diff --git a/tests/phpunit/CRM/Core/Payment/PayPalProIPNTest.php b/tests/phpunit/CRM/Core/Payment/PayPalProIPNTest.php index 68ede1d3df..949d3aa35c 100644 --- a/tests/phpunit/CRM/Core/Payment/PayPalProIPNTest.php +++ b/tests/phpunit/CRM/Core/Payment/PayPalProIPNTest.php @@ -250,6 +250,7 @@ class CRM_Core_Payment_PayPalProIPNTest extends CiviUnitTestCase { 'payment_gross' => '200.00', 'shipping' => '0.00', 'ipn_track_id' => '5r27c2e31rl7c', + 'is_unit_test' => TRUE, ); } -- 2.25.1