Commit | Line | Data |
---|---|---|
6a488035 | 1 | <?php |
fb32de45 | 2 | /** |
3 | * Test Generated example of using activity_type get API | |
4 | * * | |
6a488035 TO |
5 | */ |
6 | function activity_type_get_example(){ | |
fb32de45 | 7 | $params = array(); |
6a488035 | 8 | |
fb32de45 | 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 | } | |
6a488035 | 19 | |
fb32de45 | 20 | return $result; |
6a488035 TO |
21 | } |
22 | ||
fb32de45 | 23 | /** |
6a488035 TO |
24 | * Function returns array of result expected from previous function |
25 | */ | |
26 | function activity_type_get_expectedresult(){ | |
27 | ||
edb0d67a | 28 | $expectedResult = array( |
6a488035 TO |
29 | 'is_error' => 0, |
30 | 'version' => 3, | |
edb0d67a | 31 | 'count' => 45, |
32 | 'values' => array( | |
6a488035 TO |
33 | '1' => 'Meeting', |
34 | '2' => 'Phone Call', | |
35 | '3' => 'Email', | |
edb0d67a | 36 | '4' => 'Outbound SMS', |
6a488035 TO |
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', | |
edb0d67a | 76 | '44' => 'SMS delivery', |
77 | '45' => 'Inbound SMS', | |
6a488035 TO |
78 | ), |
79 | ); | |
80 | ||
fb32de45 | 81 | return $expectedResult; |
6a488035 TO |
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 | |
69d79249 | 89 | * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ActivityTypeTest.php |
6a488035 TO |
90 | * |
91 | * You can see the outcome of the API tests at | |
69d79249 | 92 | * https://test.civicrm.org/job/CiviCRM-master-git/ |
6a488035 TO |
93 | * |
94 | * To Learn about the API read | |
69d79249 | 95 | * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API |
6a488035 | 96 | * |
69d79249 E |
97 | * Browse the api on your own site with the api explorer |
98 | * http://MYSITE.ORG/path/to/civicrm/api/explorer | |
6a488035 TO |
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 | |
b259a4ab | 105 | */ |