Skip to content

Commit

Permalink
Merge pull request #16172 from eileenmcnaughton/happy_new_year
Browse files Browse the repository at this point in the history
2020 test fixes.
  • Loading branch information
eileenmcnaughton authored Jan 1, 2020
2 parents c323e9e + 90530b8 commit 392f716
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
3 changes: 1 addition & 2 deletions CRM/Core/Payment/Dummy.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ public function doDirectPayment(&$params) {
// be more complete.
if (!empty($params['credit_card_exp_date']['Y']) && date('Y') >
CRM_Core_Payment_Form::getCreditCardExpirationYear($params)) {
$error = new CRM_Core_Error(ts('transaction failed'));
return $error;
throw new PaymentProcessorException(ts('Invalid expiry date'));
}
//end of hook invocation
if (!empty($this->_doDirectPaymentResult)) {
Expand Down
1 change: 1 addition & 0 deletions CRM/Member/Form/MembershipRenewal.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions tests/phpunit/CRM/Event/Form/Registration/ConfirmTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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 <strong> Registered</strong>',
Expand Down
9 changes: 5 additions & 4 deletions tests/phpunit/CRM/Member/Form/MembershipRenewalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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',
Expand Down
3 changes: 1 addition & 2 deletions tests/phpunit/CRM/Member/Form/MembershipTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1195,8 +1195,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',
Expand Down

0 comments on commit 392f716

Please sign in to comment.