From 62118c6d72d63171033ec747230057119932d88c Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Tue, 21 Apr 2015 16:17:17 -0700 Subject: [PATCH] extension to test --- CRM/Contact/Form/Relationship.php | 2 +- CRM/Contribute/Form/Contribution/Confirm.php | 6 +++++- tests/phpunit/api/v3/RelationshipTest.php | 3 +++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CRM/Contact/Form/Relationship.php b/CRM/Contact/Form/Relationship.php index 275b27b66c..e566de97b8 100644 --- a/CRM/Contact/Form/Relationship.php +++ b/CRM/Contact/Form/Relationship.php @@ -99,7 +99,7 @@ class CRM_Contact_Form_Relationship extends CRM_Core_Form { public $_values; /** - * Casid if it called from case context + * Case id if it called from case context */ public $_caseId; diff --git a/CRM/Contribute/Form/Contribution/Confirm.php b/CRM/Contribute/Form/Contribution/Confirm.php index 1183dcaad0..2c3e415a8f 100644 --- a/CRM/Contribute/Form/Contribution/Confirm.php +++ b/CRM/Contribute/Form/Contribution/Confirm.php @@ -1619,6 +1619,9 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr /** * Add on behalf of organization and it's location. * + * This situation occurs when on behalf of is enabled for the contribution page and the person + * signing up does so on behalf of an organization. + * * @param array $behalfOrganization * array of organization info. * @param int $contactID @@ -1628,7 +1631,8 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr * @param array $values * form values array. * @param array $params - * @param null $fields + * @param array $fields + * Array of fields from the onbehalf profile relevant to the organization. */ public static function processOnBehalfOrganization(&$behalfOrganization, &$contactID, &$values, &$params, $fields = NULL) { $isCurrentEmployer = FALSE; diff --git a/tests/phpunit/api/v3/RelationshipTest.php b/tests/phpunit/api/v3/RelationshipTest.php index 7e0da1bf46..63bc3583df 100644 --- a/tests/phpunit/api/v3/RelationshipTest.php +++ b/tests/phpunit/api/v3/RelationshipTest.php @@ -1151,6 +1151,9 @@ class api_v3_RelationshipTest extends CiviUnitTestCase { )); $contactAMembership = $this->callAPISuccessGetSingle('membership', array('contact_id' => $this->_cId_a)); $this->assertEquals($originalMembership['id'], $contactAMembership['owner_membership_id']); + // Deleting the organization should cause the related membership to be deleted. + $this->callAPISuccess('contact', 'delete', array('id' => $this->_cId_b)); + $this->callAPISuccessGetCount('membership', array('contact_id' => $this->_cId_a), 0); } } -- 2.25.1