| 1 | <?php |
| 2 | /** |
| 3 | * Test Generated example of using activity_type get API |
| 4 | * * |
| 5 | */ |
| 6 | function activity_type_get_example(){ |
| 7 | $params = array(); |
| 8 | |
| 9 | try{ |
| 10 | $result = civicrm_api3('activity_type', 'get', $params); |
| 11 | } |
| 12 | catch (CiviCRM_API3_Exception $e) { |
| 13 | // handle error here |
| 14 | $errorMessage = $e->getMessage(); |
| 15 | $errorCode = $e->getErrorCode(); |
| 16 | $errorData = $e->getExtraParams(); |
| 17 | return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData); |
| 18 | } |
| 19 | |
| 20 | return $result; |
| 21 | } |
| 22 | |
| 23 | /** |
| 24 | * Function returns array of result expected from previous function |
| 25 | */ |
| 26 | function activity_type_get_expectedresult(){ |
| 27 | |
| 28 | $expectedResult = array( |
| 29 | 'is_error' => 0, |
| 30 | 'version' => 3, |
| 31 | 'count' => 45, |
| 32 | 'values' => array( |
| 33 | '1' => 'Meeting', |
| 34 | '2' => 'Phone Call', |
| 35 | '3' => 'Email', |
| 36 | '4' => 'Outbound SMS', |
| 37 | '5' => 'Event Registration', |
| 38 | '6' => 'Contribution', |
| 39 | '7' => 'Membership Signup', |
| 40 | '8' => 'Membership Renewal', |
| 41 | '9' => 'Tell a Friend', |
| 42 | '10' => 'Pledge Acknowledgment', |
| 43 | '11' => 'Pledge Reminder', |
| 44 | '12' => 'Inbound Email', |
| 45 | '13' => 'Open Case', |
| 46 | '14' => 'Follow up', |
| 47 | '15' => 'Change Case Type', |
| 48 | '16' => 'Change Case Status', |
| 49 | '17' => 'Membership Renewal Reminder', |
| 50 | '18' => 'Change Case Start Date', |
| 51 | '19' => 'Bulk Email', |
| 52 | '20' => 'Assign Case Role', |
| 53 | '21' => 'Remove Case Role', |
| 54 | '22' => 'Print PDF Letter', |
| 55 | '23' => 'Merge Case', |
| 56 | '24' => 'Reassigned Case', |
| 57 | '25' => 'Link Cases', |
| 58 | '26' => 'Change Case Tags', |
| 59 | '27' => 'Add Client To Case', |
| 60 | '28' => 'Survey', |
| 61 | '29' => 'Canvass', |
| 62 | '30' => 'PhoneBank', |
| 63 | '31' => 'WalkList', |
| 64 | '32' => 'Petition Signature', |
| 65 | '33' => 'Change Custom Data', |
| 66 | '34' => 'Mass SMS', |
| 67 | '35' => 'Change Membership Status', |
| 68 | '36' => 'Change Membership Type', |
| 69 | '37' => 'Cancel Recurring Contribution', |
| 70 | '38' => 'Update Recurring Contribution Billing Details', |
| 71 | '39' => 'Update Recurring Contribution', |
| 72 | '40' => 'Reminder Sent', |
| 73 | '41' => 'Export Accounting Batch', |
| 74 | '42' => 'Create Batch', |
| 75 | '43' => 'Edit Batch', |
| 76 | '44' => 'SMS delivery', |
| 77 | '45' => 'Inbound SMS', |
| 78 | ), |
| 79 | ); |
| 80 | |
| 81 | return $expectedResult; |
| 82 | } |
| 83 | |
| 84 | |
| 85 | /* |
| 86 | * This example has been generated from the API test suite. The test that created it is called |
| 87 | * |
| 88 | * testActivityTypeGet and can be found in |
| 89 | * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ActivityTypeTest.php |
| 90 | * |
| 91 | * You can see the outcome of the API tests at |
| 92 | * https://test.civicrm.org/job/CiviCRM-master-git/ |
| 93 | * |
| 94 | * To Learn about the API read |
| 95 | * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API |
| 96 | * |
| 97 | * Browse the api on your own site with the api explorer |
| 98 | * http://MYSITE.ORG/path/to/civicrm/api/explorer |
| 99 | * |
| 100 | * Read more about testing here |
| 101 | * http://wiki.civicrm.org/confluence/display/CRM/Testing |
| 102 | * |
| 103 | * API Standards documentation: |
| 104 | * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards |
| 105 | */ |