11a84829142f611555f30d67fc7faabdea8d5731
3 * Test Generated example demonstrating the Survey.create API.
8 function survey_create_example() {
10 'title' => 'survey title',
11 'activity_type_id' => '30',
12 'max_number_of_contacts' => 12,
13 'instructions' => 'Call people, ask for money',
17 $result = civicrm_api3('Survey', 'create', $params);
19 catch (CiviCRM_API3_Exception
$e) {
21 $errorMessage = $e->getMessage();
22 $errorCode = $e->getErrorCode();
23 $errorData = $e->getExtraParams();
25 'error' => $errorMessage,
26 'error_code' => $errorCode,
27 'error_data' => $errorData,
35 * Function returns array of result expected from previous function.
40 function survey_create_expectedresult() {
42 $expectedResult = array(
50 'title' => 'survey title',
52 'activity_type_id' => '30',
53 'recontact_interval' => '',
54 'instructions' => 'Call people, ask for money',
55 'release_frequency' => '',
56 'max_number_of_contacts' => '12',
57 'default_number_of_contacts' => '',
61 'created_date' => '2013-07-28 08:49:19',
62 'last_modified_id' => '',
63 'last_modified_date' => '',
65 'bypass_confirm' => '',
66 'thankyou_title' => '',
67 'thankyou_text' => '',
73 return $expectedResult;
77 * This example has been generated from the API test suite.
78 * The test that created it is called "testCreateSurvey"
79 * and can be found at:
80 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/SurveyTest.php
82 * You can see the outcome of the API tests at
83 * https://test.civicrm.org/job/CiviCRM-master-git/
85 * To Learn about the API read
86 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
88 * Browse the api on your own site with the api explorer
89 * http://MYSITE.ORG/path/to/civicrm/api
91 * Read more about testing here
92 * http://wiki.civicrm.org/confluence/display/CRM/Testing
94 * API Standards documentation:
95 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards