/** * Test civicrm_contact_memberships_get with relationship. * get Memberships. */ function testGetWithRelationship() { $orgContact = $this->organizationCreate(); $relTypeParams = array('name_a_b' => 'Relation 1', 'name_b_a' => 'Relation 2', 'description' => 'Testing relationship type', 'contact_type_a' => 'Organization', 'contact_type_b' => 'Individual', 'is_reserved' => 1, 'is_active' => 1); $relTypeID = $this->relationshipTypeCreate($relTypeParams); $params = array('contact_id_a' => $orgContact, 'contact_id_b' => $this->_contactID, 'relationship_type_id' => $relTypeID, 'start_date' => array('d' => '10', 'M' => '1', 'Y' => '2008'), 'is_active' => 1); $result =& civicrm_relationship_create($params); $params = array('name' => 'test General', 'duration_unit' => 'year', 'duration_interval' => 1, 'period_type' => 'rolling', 'member_of_contact_id' => $this->_contactID, 'domain_id' => 1, 'contribution_type_id' => 1, 'relationship_type_id' => $relTypeID, 'relationship_direction' => 'b_a', 'is_active' => 1); $memType = civicrm_membership_type_create($params); $params = array('contact_id' => $this->_contactID, 'membership_type_id' => $memType['id'], 'join_date' => '2009-01-21', 'start_date' => '2009-01-21', 'end_date' => '2009-12-21', 'source' => 'Payment', 'is_override' => 1, 'status_id' => $this->_membershipStatusID); $membershipID = $this->contactMembershipCreate($params); $params = array('contact_id' => $this->_contactID, 'membership_type_id' => $memType['id']); $membership =& civicrm_membership_contact_get($params); $result = $membership[$this->_contactID][$membershipID]; $this->assertEquals($result['status_id'], $this->_membershipStatusID, "In line " . __LINE__); $this->assertEquals($result['contact_id'], $orgContact, "In line " . __LINE__); }
/** * * @param <type> $contactID * @return <type> * @deprecated compatilibility wrappers */ function civicrm_contact_memberships_get(&$contactID) { return civicrm_membership_contact_get($contactID); }