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

Fix contribution page pledge tests to create valid contributions #20404

Merged
merged 1 commit into from
May 24, 2021

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented May 24, 2021

Overview

Fix contribution page pledge tests to create valid contributions

Before

configured contribution page is a price set page but amount being passed instead of price set params

After

price set params passed

Technical Details

Comments

This addresses an issue where they were using a contribution page with a price
set but te submit params were not valid for that price set
@civibot
Copy link

civibot bot commented May 24, 2021

(Standard links)

@civibot civibot bot added the master label May 24, 2021
@@ -1795,26 +1793,26 @@ public function testSubmitPledgePaymentPaymentProcessorRecurFuturePayment() {

// Check if pledge created.
$pledge = $this->callAPISuccess('pledge', 'getsingle', []);
$this->assertEquals(date('Ymd', strtotime($pledge['pledge_start_date'])), date('Ymd', strtotime("+1 month")));
$this->assertEquals($pledge['pledge_amount'], 300.00);
$this->assertEquals(date('Ymd', strtotime($pledge['pledge_start_date'])), date('Ymd', strtotime('+1 month')));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The configured value just happens to be 30 rather than 300 - change tests to match

$this->assertEquals(1, $pledgePayment[2]['status_id'], 'This pledge payment should have been completed');
$this->assertEquals($contribution['id'], $pledgePayment[2]['contribution_id']);
$this->assertEquals($pledgePayment[2]['contribution_id'], $contribution['id']);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eileenmcnaughton wasn't this around the right way before?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah maybe - can I fix that as a follow up?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as long as you promise to do so

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added it into #20402

@seamuslee001
Copy link
Contributor

This all seems fine

@seamuslee001 seamuslee001 merged commit 735be3a into civicrm:master May 24, 2021
@seamuslee001 seamuslee001 deleted the pledge_tax2 branch May 24, 2021 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants