Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | <?php |
2 | ||
3 | /* | |
4 | ||
5 | */ | |
6 | function survey_get_example(){ | |
fbda92d3 | 7 | $params = array( |
6a488035 | 8 | 'title' => 'survey title', |
fbda92d3 | 9 | 'activity_type_id' => '35', |
6a488035 TO |
10 | 'max_number_of_contacts' => 12, |
11 | 'instructions' => 'Call people, ask for money', | |
fbda92d3 | 12 | 'version' => 3, |
13 | 'debug' => 0, | |
6a488035 TO |
14 | ); |
15 | ||
16 | $result = civicrm_api( 'survey','get',$params ); | |
17 | ||
18 | return $result; | |
19 | } | |
20 | ||
21 | /* | |
22 | * Function returns array of result expected from previous function | |
23 | */ | |
24 | function survey_get_expectedresult(){ | |
25 | ||
fbda92d3 | 26 | $expectedResult = array( |
6a488035 TO |
27 | 'is_error' => 0, |
28 | 'version' => 3, | |
29 | 'count' => 1, | |
30 | 'id' => 1, | |
fbda92d3 | 31 | 'values' => array( |
32 | '1' => array( | |
6a488035 TO |
33 | 'id' => '1', |
34 | 'title' => 'survey title', | |
fbda92d3 | 35 | 'activity_type_id' => '35', |
6a488035 TO |
36 | 'instructions' => 'Call people, ask for money', |
37 | 'max_number_of_contacts' => '12', | |
38 | 'is_active' => '1', | |
39 | 'is_default' => 0, | |
fbda92d3 | 40 | 'created_date' => '20120130621222105', |
6a488035 TO |
41 | 'bypass_confirm' => 0, |
42 | ), | |
43 | ), | |
44 | ); | |
45 | ||
46 | return $expectedResult ; | |
47 | } | |
48 | ||
49 | ||
50 | /* | |
51 | * This example has been generated from the API test suite. The test that created it is called | |
52 | * | |
53 | * testGetSurvey and can be found in | |
54 | * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/SurveyTest.php | |
55 | * | |
56 | * You can see the outcome of the API tests at | |
57 | * http://tests.dev.civicrm.org/trunk/results-api_v3 | |
58 | * | |
59 | * To Learn about the API read | |
60 | * http://book.civicrm.org/developer/current/techniques/api/ | |
61 | * | |
62 | * and review the wiki at | |
63 | * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs | |
64 | * | |
65 | * Read more about testing here | |
66 | * http://wiki.civicrm.org/confluence/display/CRM/Testing | |
67 | * | |
68 | * API Standards documentation: | |
69 | * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards | |
70 | */ |