Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2020 test fixes. #16172

Merged
merged 1 commit into from
Jan 1, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2020 test fixes.
We have 8 tests failing that seem to be due to 2020 starting. This fixes 2
eileenmcnaughton committed Jan 1, 2020
commit 90530b8758e7d9ed88f9fc222b6eeb8a758ba4c5
3 changes: 1 addition & 2 deletions CRM/Core/Payment/Dummy.php
Original file line number Diff line number Diff line change
@@ -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)) {
1 change: 1 addition & 0 deletions CRM/Member/Form/MembershipRenewal.php
Original file line number Diff line number Diff line change
@@ -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);
4 changes: 2 additions & 2 deletions tests/phpunit/CRM/Event/Form/Registration/ConfirmTest.php
Original file line number Diff line number Diff line change
@@ -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 <strong> Registered</strong>',
9 changes: 5 additions & 4 deletions tests/phpunit/CRM/Member/Form/MembershipRenewalTest.php
Original file line number Diff line number Diff line change
@@ -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',
3 changes: 1 addition & 2 deletions tests/phpunit/CRM/Member/Form/MembershipTest.php
Original file line number Diff line number Diff line change
@@ -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',