3 * Test Generated example demonstrating the Address.create API.
5 * Demonstrates Use of address parsing param.
10 function address_create_example() {
12 'street_parsing' => 1,
13 'street_address' => '54A Excelsior Ave. Apt 1C',
14 'location_type_id' => 7,
19 $result = civicrm_api3('Address', 'create', $params);
21 catch (CiviCRM_API3_Exception
$e) {
23 $errorMessage = $e->getMessage();
24 $errorCode = $e->getErrorCode();
25 $errorData = $e->getExtraParams();
27 'error' => $errorMessage,
28 'error_code' => $errorCode,
29 'error_data' => $errorData,
37 * Function returns array of result expected from previous function.
42 function address_create_expectedresult() {
44 $expectedResult = array(
53 'location_type_id' => '7',
56 'street_address' => '54A Excelsior Ave. Apt 1C',
57 'street_number' => '54',
58 'street_number_suffix' => 'A',
59 'street_name' => 'Excelsior Ave.',
60 'street_unit' => 'Apt 1C',
61 'manual_geo_code' => 0,
66 return $expectedResult;
70 * This example has been generated from the API test suite.
71 * The test that created it is called "testCreateAddressParsing"
72 * and can be found at:
73 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/AddressTest.php
75 * You can see the outcome of the API tests at
76 * https://test.civicrm.org/job/CiviCRM-master-git/
78 * To Learn about the API read
79 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
81 * Browse the api on your own site with the api explorer
82 * http://MYSITE.ORG/path/to/civicrm/api
84 * Read more about testing here
85 * http://wiki.civicrm.org/confluence/display/CRM/Testing
87 * API Standards documentation:
88 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards