From 28de42d1b345a8da4655488a693bce7b2b3ce563 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Thu, 12 Feb 2015 18:39:35 +1300 Subject: [PATCH] preliminary tidy up --- CRM/Core/Payment/BaseIPN.php | 6 ++++-- tests/phpunit/api/v3/ContributionTest.php | 17 ++++++++--------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/CRM/Core/Payment/BaseIPN.php b/CRM/Core/Payment/BaseIPN.php index dfb319a34e..f8b2839fd1 100644 --- a/CRM/Core/Payment/BaseIPN.php +++ b/CRM/Core/Payment/BaseIPN.php @@ -182,9 +182,11 @@ class CRM_Core_Payment_BaseIPN { /** * Set contribution to failed. + * * @param array $objects * @param object $transaction * @param array $input + * * @return bool */ public function failed(&$objects, &$transaction, $input = array()) { @@ -214,7 +216,7 @@ class CRM_Core_Payment_BaseIPN { $contribution->contribution_status_id = $contributionStatuses['Failed']; $contribution->save(); - //add lineitems for recurring payments + // Add line items for recurring payments. if (!empty($objects['contributionRecur']) && $objects['contributionRecur']->id && $addLineItems) { $this->addRecurLineItems($objects['contributionRecur']->id, $contribution); } @@ -602,7 +604,7 @@ LIMIT 1;"; } $contribution->save(); - //add new soft credit against current $contribution and + // Add new soft credit against current $contribution. if (CRM_Utils_Array::value('contributionRecur', $objects) && $objects['contributionRecur']->id) { $this->addrecurSoftCredit($objects['contributionRecur']->id, $contribution->id); } diff --git a/tests/phpunit/api/v3/ContributionTest.php b/tests/phpunit/api/v3/ContributionTest.php index 0a16cbfa5e..6f81b00bb5 100644 --- a/tests/phpunit/api/v3/ContributionTest.php +++ b/tests/phpunit/api/v3/ContributionTest.php @@ -261,8 +261,6 @@ class api_v3_ContributionTest extends CiviUnitTestCase { )); } - ///////////////// civicrm_contribution_ - /** * Create an contribution_id=FALSE and financial_type_id=Donation. */ @@ -427,7 +425,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { } /** - * Test create with valid payment instument. + * Test create with valid payment instrument. */ public function testCreateContributionWithPaymentInstrument() { $params = $this->_params + array('payment_instrument' => 'EFT'); @@ -935,10 +933,10 @@ class api_v3_ContributionTest extends CiviUnitTestCase { $this->assertEquals('125.00', $lineItems); $trxnAmount = $this->_getFinancialTrxnAmount($contribution['id']); - $fitemAmount = $this->_getFinancialItemAmount($contribution['id']); - // Financial trxn SUM = 125 + 5 (fee) + + // Financial trxn SUM = 125 + 5 (fee). $this->assertEquals('130.00', $trxnAmount); - $this->assertEquals('125.00', $fitemAmount); + $this->assertEquals('125.00', $this->_getFinancialItemAmount($contribution['id'])); } /** @@ -1104,7 +1102,8 @@ class api_v3_ContributionTest extends CiviUnitTestCase { } /** - * To Update Contribution. + * Test Updating a Contribution. + * * CHANGE: we require the API to do an incremental update */ public function testCreateUpdateContribution() { @@ -1115,7 +1114,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { ); $original = $this->callAPISuccess('contribution', 'get', $old_params); - //Make sure it came back + // Make sure it came back. $this->assertAPISuccess($original); $this->assertEquals($original['id'], $contributionID); //set up list of old params, verify @@ -1406,7 +1405,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { /** * This could be merged with 4.5 function setup in api_v3_ContributionPageTest::setUpContributionPage - * on parent class at some point (fn is not in 4.4) + * on parent class at some point (fn is not in 4.4). * @param $entity * @param array $params */ -- 2.25.1