Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | <?php |
2 | ||
3 | /* | |
4 | ||
5 | */ | |
6 | function note_get_example(){ | |
53ca8fd7 | 7 | $params = array( |
6a488035 TO |
8 | 'entity_table' => 'civicrm_contact', |
9 | 'entity_id' => 1, | |
10 | 'note' => 'Hello!!! m testing Note', | |
11 | 'contact_id' => 1, | |
12 | 'modified_date' => '2011-01-31', | |
13 | 'subject' => 'Test Note', | |
14 | 'version' => 3, | |
15 | ); | |
16 | ||
17 | $result = civicrm_api( 'note','get',$params ); | |
18 | ||
19 | return $result; | |
20 | } | |
21 | ||
22 | /* | |
23 | * Function returns array of result expected from previous function | |
24 | */ | |
25 | function note_get_expectedresult(){ | |
26 | ||
53ca8fd7 | 27 | $expectedResult = array( |
6a488035 TO |
28 | 'is_error' => 0, |
29 | 'version' => 3, | |
30 | 'count' => 1, | |
31 | 'id' => 1, | |
53ca8fd7 | 32 | 'values' => array( |
33 | '1' => array( | |
6a488035 TO |
34 | 'id' => '1', |
35 | 'entity_table' => 'civicrm_contact', | |
36 | 'entity_id' => '1', | |
37 | 'note' => 'hello I am testing Note', | |
38 | 'contact_id' => '1', | |
39 | 'modified_date' => '2012-11-14 16:02:35', | |
40 | 'subject' => 'Test Note', | |
41 | 'privacy' => 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 | * testGet and can be found in | |
54 | * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/NoteTest.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 | */ |