3 * Test Generated example of using address get API
6 function address_get_example(){
9 'street_name' => 'Ambachtstraat',
13 $result = civicrm_api3('address', 'get', $params);
15 catch (CiviCRM_API3_Exception
$e) {
17 $errorMessage = $e->getMessage();
18 $errorCode = $e->getErrorCode();
19 $errorData = $e->getExtraParams();
20 return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
27 * Function returns array of result expected from previous function
29 function address_get_expectedresult(){
31 $expectedResult = array(
40 'location_type_id' => '12',
43 'street_address' => 'Ambachtstraat 23',
44 'street_number' => '23',
45 'street_name' => 'Ambachtstraat',
47 'postal_code' => '6971 BN',
48 'country_id' => '1152',
49 'manual_geo_code' => 0,
54 return $expectedResult;
59 * This example has been generated from the API test suite. The test that created it is called
61 * testGetAddress and can be found in
62 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/AddressTest.php
64 * You can see the outcome of the API tests at
65 * https://test.civicrm.org/job/CiviCRM-master-git/
67 * To Learn about the API read
68 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
70 * Browse the api on your own site with the api explorer
71 * http://MYSITE.ORG/path/to/civicrm/api/explorer
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