From 8574a067f790423347dbdf8fc73bc07b09f041c8 Mon Sep 17 00:00:00 2001 From: Matthew Wire Date: Thu, 1 Feb 2018 21:26:10 +0700 Subject: [PATCH] Fix PaypalIPNTest frequency unit and rename mispelled file for test class --- .../Core/Payment/{PayPalPNTest.php => PayPalIPNTest.php} | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) rename tests/phpunit/CRM/Core/Payment/{PayPalPNTest.php => PayPalIPNTest.php} (96%) diff --git a/tests/phpunit/CRM/Core/Payment/PayPalPNTest.php b/tests/phpunit/CRM/Core/Payment/PayPalIPNTest.php similarity index 96% rename from tests/phpunit/CRM/Core/Payment/PayPalPNTest.php rename to tests/phpunit/CRM/Core/Payment/PayPalIPNTest.php index 145401025ab2..e71dff059b0e 100644 --- a/tests/phpunit/CRM/Core/Payment/PayPalPNTest.php +++ b/tests/phpunit/CRM/Core/Payment/PayPalIPNTest.php @@ -145,7 +145,8 @@ public function testIPNPaymentRecurSuccess() { * Test IPN response updates contribution_recur & contribution for first & second contribution. */ public function testIPNPaymentMembershipRecurSuccess() { - $this->setupMembershipRecurringPaymentProcessorTransaction(); + $durationUnit = 'year'; + $this->setupMembershipRecurringPaymentProcessorTransaction(array('duration_unit' => $durationUnit, 'frequency_unit' => $durationUnit)); $this->callAPISuccessGetSingle('membership_payment', array()); $paypalIPN = new CRM_Core_Payment_PayPalIPN($this->getPaypalRecurTransaction()); $paypalIPN->main(); @@ -159,7 +160,8 @@ public function testIPNPaymentMembershipRecurSuccess() { $this->assertEquals(5, $contributionRecur['contribution_status_id']); $paypalIPN = new CRM_Core_Payment_PaypalIPN($this->getPaypalRecurSubsequentTransaction()); $paypalIPN->main(); - $this->assertEquals(strtotime('+ 1 year', strtotime($membershipEndDate)), strtotime($this->callAPISuccessGetValue('membership', array('return' => 'end_date')))); + $renewedMembershipEndDate = $this->membershipRenewalDate($durationUnit, $membershipEndDate); + $this->assertEquals($renewedMembershipEndDate, $this->callAPISuccessGetValue('membership', array('return' => 'end_date'))); $contribution = $this->callAPISuccess('contribution', 'get', array( 'contribution_recur_id' => $this->_contributionRecurID, 'sequential' => 1,