3 * Test Generated example of using membership update API
6 function membership_update_example(){
9 'membership_type_id' => 54,
10 'join_date' => '2009-01-21',
11 'start_date' => '2009-01-21',
12 'end_date' => '2009-12-21',
13 'source' => 'Payment',
16 'custom_1' => 'custom string',
20 $result = civicrm_api3('membership', 'update', $params);
22 catch (CiviCRM_API3_Exception
$e) {
24 $errorMessage = $e->getMessage();
25 $errorCode = $e->getErrorCode();
26 $errorData = $e->getExtraParams();
27 return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
34 * Function returns array of result expected from previous function
36 function membership_update_expectedresult(){
38 $expectedResult = array(
47 'membership_type_id' => '54',
48 'join_date' => '20090121000000',
49 'start_date' => '2013-07-29 00:00:00',
50 'end_date' => '2013-08-04 00:00:00',
51 'source' => 'Payment',
54 'owner_membership_id' => '',
58 'contribution_recur_id' => '',
64 return $expectedResult;
69 * This example has been generated from the API test suite. The test that created it is called
71 * testUpdateWithCustom and can be found in
72 * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/MembershipTest.php
74 * You can see the outcome of the API tests at
75 * http://tests.dev.civicrm.org/trunk/results-api_v3
77 * To Learn about the API read
78 * http://book.civicrm.org/developer/current/techniques/api/
80 * and review the wiki at
81 * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
83 * Read more about testing here
84 * http://wiki.civicrm.org/confluence/display/CRM/Testing
86 * API Standards documentation:
87 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards