From 7017c7448b12a4e573c5988451ef7b0cda86b2d0 Mon Sep 17 00:00:00 2001 From: eileen Date: Wed, 1 Jan 2020 16:22:32 +1300 Subject: [PATCH] 2020 test fixes. We have 8 tests failing that seem to be due to 2020 starting. This fixes 2 --- CRM/Member/Form/MembershipRenewal.php | 1 + .../phpunit/CRM/Event/Form/Registration/ConfirmTest.php | 4 ++-- tests/phpunit/CRM/Member/Form/MembershipRenewalTest.php | 9 +++++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CRM/Member/Form/MembershipRenewal.php b/CRM/Member/Form/MembershipRenewal.php index 36aecfce2d5..f6e50c2d87c 100644 --- a/CRM/Member/Form/MembershipRenewal.php +++ b/CRM/Member/Form/MembershipRenewal.php @@ -477,6 +477,7 @@ public function postProcess() { * This function is also accessed by a unit test. * * @throws \CRM_Core_Exception + * @throws \CiviCRM_API3_Exception */ protected function submit() { $this->storeContactFields($this->_params); diff --git a/tests/phpunit/CRM/Event/Form/Registration/ConfirmTest.php b/tests/phpunit/CRM/Event/Form/Registration/ConfirmTest.php index ba5884f24a2..cae3633d36a 100644 --- a/tests/phpunit/CRM/Event/Form/Registration/ConfirmTest.php +++ b/tests/phpunit/CRM/Event/Form/Registration/ConfirmTest.php @@ -124,7 +124,7 @@ public function testPaidSubmit($thousandSeparator) { 'cvv2' => '123', 'credit_card_exp_date' => [ 'M' => '1', - 'Y' => '2019', + 'Y' => date('Y') + 1, ], 'credit_card_type' => 'Visa', 'billing_first_name' => 'p', @@ -207,7 +207,7 @@ public function testPaidSubmit($thousandSeparator) { ], $entityFinancialTrxns[2], ['id', 'entity_id']); $mut->checkMailLog([ 'Event Information and Location', 'Registration Confirmation - Annual CiviCRM meet', - 'Expires: January 2019', + 'Expires: January ' . (date('Y') + 1), 'Visa', '************1111', 'This is a confirmation that your registration has been received and your status has been updated to Registered', diff --git a/tests/phpunit/CRM/Member/Form/MembershipRenewalTest.php b/tests/phpunit/CRM/Member/Form/MembershipRenewalTest.php index 197bd8cd7e5..2cdce1e8061 100644 --- a/tests/phpunit/CRM/Member/Form/MembershipRenewalTest.php +++ b/tests/phpunit/CRM/Member/Form/MembershipRenewalTest.php @@ -234,8 +234,7 @@ public function testSubmitRecur() { 'cvv2' => '123', 'credit_card_exp_date' => [ 'M' => '9', - // TODO: Future proof - 'Y' => '2019', + 'Y' => date('Y') + 1, ], 'credit_card_type' => 'Visa', 'billing_first_name' => 'Test', @@ -357,6 +356,9 @@ public function testSubmitRecurCompleteInstant() { * @param string $thousandSeparator * * @dataProvider getThousandSeparators + * + * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function testSubmitRecurCompleteInstantWithMail($thousandSeparator) { $this->setCurrencySeparators($thousandSeparator); @@ -614,8 +616,7 @@ protected function getBaseSubmitParams() { 'cvv2' => '123', 'credit_card_exp_date' => [ 'M' => '9', - // TODO: Future proof - 'Y' => '2019', + 'Y' => date('Y') + 1, ], 'credit_card_type' => 'Visa', 'billing_first_name' => 'Test',