forked from civicrm/civicrm-core
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request civicrm#29730 from eileenmcnaughton/membership_sunil
dev/core#3752 Fix issue with price set membership terms
- Loading branch information
Showing
4 changed files
with
30 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1337,6 +1337,7 @@ public function buildAmountMembershipDiscount($pageType, &$form, &$amount) { | |
* @param array $formValues | ||
* | ||
* @return \CRM_Member_Form_Membership | ||
* @throws \CRM_Core_Exception | ||
*/ | ||
protected function getForm(array $formValues = []): CRM_Member_Form_Membership { | ||
if (isset($_REQUEST['cid'])) { | ||
|
@@ -1583,12 +1584,10 @@ private function getExpectedEmailStrings(): array { | |
/** | ||
* Test that membership end_date is correct for multiple terms for pending contribution | ||
* | ||
* @throws \CRM_Core_Exception | ||
* @throws \Exception | ||
*/ | ||
public function testCreatePendingWithMultipleTerms(): void { | ||
CRM_Core_Session::singleton()->getStatus(TRUE); | ||
$mailUtil = new CiviMailUtils($this, TRUE); | ||
$this->createLoggedInUser(); | ||
$membershipTypeAnnualRolling = $this->callAPISuccess('membership_type', 'create', [ | ||
'domain_id' => 1, | ||
|
@@ -1603,7 +1602,7 @@ public function testCreatePendingWithMultipleTerms(): void { | |
'financial_type_id' => 2, | ||
]); | ||
$params = [ | ||
'cid' => $this->ids['Contact']['individual_0'], | ||
'contact_id' => $this->ids['Contact']['individual_0'], | ||
'join_date' => date('Y-m-d'), | ||
'start_date' => '', | ||
'end_date' => '', | ||
|
@@ -1620,10 +1619,8 @@ public function testCreatePendingWithMultipleTerms(): void { | |
'from_email_address' => '"Demonstrators Anonymous" <[email protected]>', | ||
'receipt_text' => '', | ||
]; | ||
$form = $this->getForm(); | ||
$form->preProcess(); | ||
$form->_contactID = $this->ids['Contact']['individual_0']; | ||
$form->testSubmit($params); | ||
$form = $this->getTestForm('CRM_Member_Form_Membership', $params); | ||
$form->processForm(); | ||
$membership = $this->callAPISuccessGetSingle('Membership', ['contact_id' => $this->ids['Contact']['individual_0']]); | ||
// Check if Membership is set to Pending. | ||
$this->assertEquals(CRM_Core_PseudoConstant::getKey('CRM_Member_BAO_Membership', 'status_id', 'Pending'), $membership['status_id']); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters