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