/** * Test civicrm_membership_delete() with invalid Membership Id */ function testMembershipDeleteWithInvalidMembershipId() { $membershipId = 'membership'; $result = civicrm_membership_delete($membershipId); $this->assertEquals($result['is_error'], 1, "In line " . __LINE__); $membershipId = 2.4; $result = civicrm_membership_delete($membershipId); $this->assertEquals($result['is_error'], 1, "In line " . __LINE__); $membershipId = array('id' => $this->_membershipID); $result = civicrm_membership_delete($membershipId); $this->assertEquals($result['is_error'], 1, "In line " . __LINE__); }
function testMembershipDelete() { $result = civicrm_membership_delete($this->_membershipID); $this->assertEquals($result['is_error'], 0); }
function membershipDelete($membershipID) { $result = civicrm_membership_delete($membershipID); if (CRM_Utils_Array::value('is_error', $result)) { throw new Exception('Could not delete membership'); } return; }