3 * Test Generated example demonstrating the Address.get API.
5 * Demonstrates Use of sort filter.
10 function address_get_example() {
13 'sort' => 'street_address DESC',
20 $result = civicrm_api3('Address', 'get', $params);
22 catch (CiviCRM_API3_Exception
$e) {
24 $errorMessage = $e->getMessage();
25 $errorCode = $e->getErrorCode();
26 $errorData = $e->getExtraParams();
28 'error' => $errorMessage,
29 'error_code' => $errorCode,
30 'error_data' => $errorData,
38 * Function returns array of result expected from previous function.
43 function address_get_expectedresult() {
45 $expectedResult = array(
53 'location_type_id' => '17',
56 'street_address' => 'yzy',
57 'street_number' => '23',
58 'street_name' => 'Ambachtstraat',
60 'postal_code' => '6971 BN',
61 'country_id' => '1152',
62 'manual_geo_code' => 0,
67 'location_type_id' => '17',
70 'street_address' => 'Ambachtstraat 23',
71 'street_number' => '23',
72 'street_name' => 'Ambachtstraat',
74 'postal_code' => '6971 BN',
75 'country_id' => '1152',
76 'manual_geo_code' => 0,
81 return $expectedResult;
85 * This example has been generated from the API test suite.
86 * The test that created it is called "testGetAddressSort"
87 * and can be found at:
88 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/AddressTest.php
90 * You can see the outcome of the API tests at
91 * https://test.civicrm.org/job/CiviCRM-master-git/
93 * To Learn about the API read
94 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
96 * Browse the api on your own site with the api explorer
97 * http://MYSITE.ORG/path/to/civicrm/api
99 * Read more about testing here
100 * http://wiki.civicrm.org/confluence/display/CRM/Testing
102 * API Standards documentation:
103 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards