Merge pull request #265 from colemanw/del-fix
[civicrm-core.git] / api / v3 / examples / AddressGet.php
1 <?php
2
3 /*
4
5 */
6 function address_get_example(){
7 $params = array(
8 'contact_id' => 9,
9 'street_name' => 'Ambachtstraat',
10 'version' => 3,
11 );
12
13 $result = civicrm_api( 'address','get',$params );
14
15 return $result;
16 }
17
18 /*
19 * Function returns array of result expected from previous function
20 */
21 function address_get_expectedresult(){
22
23 $expectedResult = array(
24 'is_error' => 0,
25 'version' => 3,
26 'count' => 1,
27 'id' => 7,
28 'values' => array(
29 '7' => array(
30 'id' => '7',
31 'contact_id' => '9',
32 'location_type_id' => '12',
33 'is_primary' => '1',
34 'is_billing' => 0,
35 'street_address' => 'Ambachtstraat 23',
36 'street_number' => '23',
37 'street_name' => 'Ambachtstraat',
38 'city' => 'Brummen',
39 'postal_code' => '6971 BN',
40 'country_id' => '1152',
41 'manual_geo_code' => 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 * testGetAddress and can be found in
54 * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/AddressTest.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 */