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