| 1 | <?php |
| 2 | |
| 3 | /* |
| 4 | |
| 5 | */ |
| 6 | function membership_type_get_example(){ |
| 7 | $params = array( |
| 8 | 'id' => 1, |
| 9 | 'version' => 3, |
| 10 | ); |
| 11 | |
| 12 | $result = civicrm_api( 'membership_type','get',$params ); |
| 13 | |
| 14 | return $result; |
| 15 | } |
| 16 | |
| 17 | /* |
| 18 | * Function returns array of result expected from previous function |
| 19 | */ |
| 20 | function membership_type_get_expectedresult(){ |
| 21 | |
| 22 | $expectedResult = array( |
| 23 | 'is_error' => 0, |
| 24 | 'version' => 3, |
| 25 | 'count' => 1, |
| 26 | 'id' => 1, |
| 27 | 'values' => array( |
| 28 | '1' => array( |
| 29 | 'id' => '1', |
| 30 | 'domain_id' => '1', |
| 31 | 'name' => 'General', |
| 32 | 'member_of_contact_id' => '1', |
| 33 | 'financial_type_id' => '1', |
| 34 | 'minimum_fee' => '0.00', |
| 35 | 'duration_unit' => 'year', |
| 36 | 'duration_interval' => '1', |
| 37 | 'period_type' => 'rolling', |
| 38 | 'visibility' => '1', |
| 39 | 'auto_renew' => 0, |
| 40 | 'is_active' => '1', |
| 41 | ), |
| 42 | ), |
| 43 | ); |
| 44 | |
| 45 | return $expectedResult ; |
| 46 | } |
| 47 | |
| 48 | |
| 49 | /* |
| 50 | * This example has been generated from the API test suite. The test that created it is called |
| 51 | * |
| 52 | * testGet and can be found in |
| 53 | * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/MembershipTypeTest.php |
| 54 | * |
| 55 | * You can see the outcome of the API tests at |
| 56 | * http://tests.dev.civicrm.org/trunk/results-api_v3 |
| 57 | * |
| 58 | * To Learn about the API read |
| 59 | * http://book.civicrm.org/developer/current/techniques/api/ |
| 60 | * |
| 61 | * and review the wiki at |
| 62 | * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs |
| 63 | * |
| 64 | * Read more about testing here |
| 65 | * http://wiki.civicrm.org/confluence/display/CRM/Testing |
| 66 | * |
| 67 | * API Standards documentation: |
| 68 | * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards |
| 69 | */ |