From 3d3639771d35e717a64418e5c0744f90b3b504ba Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Mon, 13 Jul 2015 11:25:23 +1200 Subject: [PATCH] test fix --- CRM/Contribute/BAO/Contribution.php | 5 ++--- tests/phpunit/CRM/Core/Payment/BaseIPNTest.php | 2 ++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index 40dff6d26e..534b387ced 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -2075,9 +2075,8 @@ INNER JOIN civicrm_activity ON civicrm_activity_contact.activity_id = civicrm_ac $paymentProcessorID = CRM_Utils_Array::value('paymentProcessor', $ids); $contributionType = new CRM_Financial_BAO_FinancialType(); $contributionType->id = $this->financial_type_id; - if (!$contributionType->find(TRUE)) { - throw new Exception("Could not find financial type record: " . $this->financial_type_id); - } + $contributionType->find(TRUE); + if (!empty($ids['contact'])) { $this->_relatedObjects['contact'] = new CRM_Contact_BAO_Contact(); $this->_relatedObjects['contact']->id = $ids['contact']; diff --git a/tests/phpunit/CRM/Core/Payment/BaseIPNTest.php b/tests/phpunit/CRM/Core/Payment/BaseIPNTest.php index 495c42fa27..82ecc9ab0b 100644 --- a/tests/phpunit/CRM/Core/Payment/BaseIPNTest.php +++ b/tests/phpunit/CRM/Core/Payment/BaseIPNTest.php @@ -422,6 +422,8 @@ class CRM_Core_Payment_BaseIPNTest extends CiviUnitTestCase { if (!empty($contributionPage)) { $dao = new CRM_Core_DAO(); $contribution_page = $dao->createTestObject('CRM_Contribute_DAO_ContributionPage'); + $contribution_page->payment_processor = 1; + $contribution_page->save(); $contribution->contribution_page_id = $contributionPageID = $contribution_page->id; //for unknown reasons trying to do a find & save on a contribution with a receive_date set // doesn't work. This seems of minimal relevance to this test so ignoring -- 2.25.1