From 435fc6437a1ace17127931cc681d4b9f454a594c Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Mon, 7 Jun 2021 14:20:50 +1200 Subject: [PATCH] Fix the ContributionPageTest to set up valid memberships Fix for https://github.com/civicrm/civicrm-core/pull/20495 - resolve invalid test config --- tests/phpunit/api/v3/ContributionPageTest.php | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/tests/phpunit/api/v3/ContributionPageTest.php b/tests/phpunit/api/v3/ContributionPageTest.php index 52aa8fd34b..523b42913a 100644 --- a/tests/phpunit/api/v3/ContributionPageTest.php +++ b/tests/phpunit/api/v3/ContributionPageTest.php @@ -852,24 +852,11 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase { $expectedMembershipStatus = 5; } - $submitParams = [ - 'price_' . $this->_ids['price_field'][0] => reset($this->_ids['price_field_value']), - 'id' => (int) $this->_ids['contribution_page'], - 'amount' => 10, - 'billing_first_name' => 'Billy', - 'billing_middle_name' => 'Goat', - 'billing_last_name' => 'Gruff', - 'email' => 'billy@goat.gruff', - 'selectMembership' => $this->ids['MembershipType'], - 'payment_processor_id' => 1, - 'credit_card_number' => '4111111111111111', - 'credit_card_type' => 'Visa', - 'credit_card_exp_date' => ['M' => 9, 'Y' => 2040], - 'cvv2' => 123, + $submitParams = array_merge($this->getSubmitParamsMembership(TRUE), [ 'is_recur' => 1, 'frequency_interval' => 1, 'frequency_unit' => $this->params['recur_frequency_unit'], - ]; + ]); $this->callAPIAndDocument('ContributionPage', 'submit', $submitParams, __FUNCTION__, __FILE__, 'submit contribution page'); $contribution = $this->callAPISuccess('contribution', 'getsingle', [ -- 2.25.1