4 * Test Generated API Example.
5 * See bottom of this file for more detail.
9 * Test Generated example of using batch create API.
15 function batch_create_example() {
17 'name' => 'New_Batch_03',
18 'title' => 'New Batch 03',
19 'description' => 'This is description for New Batch 03',
26 $result = civicrm_api3('batch', 'create', $params);
28 catch (CiviCRM_API3_Exception
$e) {
30 $errorMessage = $e->getMessage();
31 $errorCode = $e->getErrorCode();
32 $errorData = $e->getExtraParams();
34 'error' => $errorMessage,
35 'error_code' => $errorCode,
36 'error_data' => $errorData,
44 * Function returns array of result expected from previous function.
49 function batch_create_expectedresult() {
51 $expectedResult = array(
59 'name' => 'New_Batch_03',
60 'title' => 'New Batch 03',
61 'description' => 'This is description for New Batch 03',
65 'modified_date' => '2012-11-14 16:02:35',
66 'saved_search_id' => '',
72 'payment_instrument_id' => '',
73 'exported_date' => '',
79 return $expectedResult;
83 * This example has been generated from the API test suite.
84 * The test that created it is called
87 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/BatchTest.php
89 * You can see the outcome of the API tests at
90 * https://test.civicrm.org/job/CiviCRM-master-git/
92 * To Learn about the API read
93 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
95 * Browse the api on your own site with the api explorer
96 * http://MYSITE.ORG/path/to/civicrm/api/explorer
98 * Read more about testing here
99 * http://wiki.civicrm.org/confluence/display/CRM/Testing
101 * API Standards documentation:
102 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards