9 function contact_create_example() {
11 'first_name' => 'abc3',
12 'last_name' => 'xyz3',
13 'contact_type' => 'Individual',
14 'email' => 'man3@yahoo.com',
16 'api.contribution.create' => array(
17 'receive_date' => '2010-01-01',
18 'total_amount' => '100',
19 'financial_type_id' => 1,
20 'payment_instrument_id' => 1,
21 'non_deductible_amount' => '10',
25 'invoice_id' => 67890,
27 'contribution_status_id' => 1,
29 'api.website.create' => array(
31 'url' => 'http://civicrm.org',
34 'url' => 'http://chained.org',
35 'website_type_id' => 2,
40 require_once 'api/api.php';
41 $result = civicrm_api('contact', 'create', $params);
47 * Function returns array of result expected from previous function
49 function contact_create_expectedresult() {
51 $expectedResult = array(
59 'contact_type' => 'Individual',
60 'contact_sub_type' => 'null',
67 'legal_identifier' => '',
68 'external_identifier' => '',
69 'sort_name' => 'xyz3, abc3',
70 'display_name' => 'abc3 xyz3',
74 'preferred_communication_method' => '',
75 'preferred_language' => 'en_US',
76 'preferred_mail_format' => '',
78 'first_name' => 'abc3',
80 'last_name' => 'xyz3',
83 'email_greeting_id' => '',
84 'email_greeting_custom' => '',
85 'email_greeting_display' => '',
86 'postal_greeting_id' => '',
87 'postal_greeting_custom' => '',
88 'postal_greeting_display' => '',
90 'addressee_custom' => '',
91 'addressee_display' => '',
96 'deceased_date' => '',
97 'household_name' => '',
98 'primary_contact_id' => '',
99 'organization_name' => '',
101 'user_unique_id' => '',
102 'api.contribution.create' => array(
111 'financial_type_id' => 1,
112 'contribution_page_id' => '',
113 'payment_instrument_id' => 1,
114 'receive_date' => '20100101000000',
115 'non_deductible_amount' => '10',
116 'total_amount' => '100',
117 'fee_amount' => '50',
118 'net_amount' => '90',
120 'invoice_id' => 67890,
123 'cancel_reason' => '',
124 'receipt_date' => '',
125 'thankyou_date' => '',
127 'amount_level' => '',
128 'contribution_recur_id' => '',
129 'honor_contact_id' => '',
131 'is_pay_later' => '',
132 'contribution_status_id' => 1,
133 'honor_type_id' => '',
135 'check_number' => 'null',
140 'api.website.create' => array(
150 'url' => 'http://civicrm.org',
151 'website_type_id' => '',
164 'url' => 'http://chained.org',
165 'website_type_id' => 2,
174 return $expectedResult;
181 * This example has been generated from the API test suite. The test that created it is called
183 * testCreateIndividualWithContributionChainedArrays and can be found in
184 * http://svn.civicrm.org/civicrm/branches/v3.4/tests/phpunit/CiviTest/api/v3/ContactTest.php
186 * You can see the outcome of the API tests at
187 * http://tests.dev.civicrm.org/trunk/results-api_v3
188 * and review the wiki at
189 * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
190 * Read more about testing here
191 * http://wiki.civicrm.org/confluence/display/CRM/Testing