3 * Test Generated example of using survey get API
6 function survey_get_example(){
8 'title' => 'survey title',
9 'activity_type_id' => '35',
10 'max_number_of_contacts' => 12,
11 'instructions' => 'Call people, ask for money',
15 $result = civicrm_api3('survey', 'get', $params);
17 catch (CiviCRM_API3_Exception
$e) {
19 $errorMessage = $e->getMessage();
20 $errorCode = $e->getErrorCode();
21 $errorData = $e->getExtraParams();
22 return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
29 * Function returns array of result expected from previous function
31 function survey_get_expectedresult(){
33 $expectedResult = array(
41 'title' => 'survey title',
42 'activity_type_id' => '35',
43 'instructions' => 'Call people, ask for money',
44 'max_number_of_contacts' => '12',
47 'created_date' => '2013-07-28 08:49:19',
48 'bypass_confirm' => 0,
54 return $expectedResult;
59 * This example has been generated from the API test suite. The test that created it is called
61 * testGetSurvey and can be found in
62 * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/SurveyTest.php
64 * You can see the outcome of the API tests at
65 * http://tests.dev.civicrm.org/trunk/results-api_v3
67 * To Learn about the API read
68 * http://book.civicrm.org/developer/current/techniques/api/
70 * and review the wiki at
71 * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
73 * Read more about testing here
74 * http://wiki.civicrm.org/confluence/display/CRM/Testing
76 * API Standards documentation:
77 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards