Merge pull request #520 from dlobo/CRM-12274
[civicrm-core.git] / api / v3 / examples / DomainGet.php
1 <?php
2
3 /*
4
5 */
6 function domain_get_example(){
7 $params = array(
8 'version' => 3,
9 'sequential' => 1,
10 );
11
12 $result = civicrm_api( 'domain','get',$params );
13
14 return $result;
15 }
16
17 /*
18 * Function returns array of result expected from previous function
19 */
20 function domain_get_expectedresult(){
21
22 $expectedResult = array(
23 'is_error' => 0,
24 'version' => 3,
25 'count' => 2,
26 'values' => array(
27 '0' => array(
28 'id' => '1',
29 'name' => 'Default Domain Name',
30 'version' => '3',
31 'contact_id' => '3',
32 'domain_email' => 'my@email.com',
33 'domain_phone' => array(
34 'phone_type' => 'Phone',
35 'phone' => '456-456',
36 ),
37 'domain_address' => array(
38 'street_address' => '45 Penny Lane',
39 'supplemental_address_1' => '',
40 'supplemental_address_2' => '',
41 'city' => '',
42 'state_province_id' => '',
43 'postal_code' => '',
44 'country_id' => '',
45 'geo_code_1' => '',
46 'geo_code_2' => '',
47 ),
48 'from_email' => 'info@EXAMPLE.ORG',
49 'from_name' => 'FIXME',
50 ),
51 '1' => array(
52 'id' => '2',
53 'name' => 'Second Domain',
54 'version' => '4.3.alpha1',
55 'contact_id' => '2',
56 'domain_email' => '"Domain Email" <domainemail2@example.org>',
57 'domain_phone' => array(
58 'phone_type' => 'Phone',
59 'phone' => '204 555-1001',
60 ),
61 'domain_address' => array(
62 'street_address' => '15 Main St',
63 'supplemental_address_1' => '',
64 'supplemental_address_2' => '',
65 'city' => 'Collinsville',
66 'state_province_id' => '1006',
67 'postal_code' => '6022',
68 'country_id' => '1228',
69 'geo_code_1' => '41.8328',
70 'geo_code_2' => '-72.9253',
71 ),
72 'from_email' => 'info@EXAMPLE.ORG',
73 'from_name' => 'FIXME',
74 ),
75 ),
76 );
77
78 return $expectedResult ;
79 }
80
81
82 /*
83 * This example has been generated from the API test suite. The test that created it is called
84 *
85 * testGet and can be found in
86 * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/DomainTest.php
87 *
88 * You can see the outcome of the API tests at
89 * http://tests.dev.civicrm.org/trunk/results-api_v3
90 *
91 * To Learn about the API read
92 * http://book.civicrm.org/developer/current/techniques/api/
93 *
94 * and review the wiki at
95 * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
96 *
97 * Read more about testing here
98 * http://wiki.civicrm.org/confluence/display/CRM/Testing
99 *
100 * API Standards documentation:
101 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
102 */