4 demonstrates creating two websites as an array
6 function contact_create_example(){
8 'first_name' => 'abc3',
10 'contact_type' => 'Individual',
11 'email' => 'man3@yahoo.com',
13 'api.contribution.create' => array(
14 'receive_date' => '2010-01-01',
15 'total_amount' => '100',
16 'financial_type_id' => 1,
17 'payment_instrument_id' => 1,
18 'non_deductible_amount' => '10',
22 'invoice_id' => 67890,
24 'contribution_status_id' => 1,
26 'api.website.create' => array(
28 'url' => 'http://civicrm.org',
31 'url' => 'http://chained.org',
32 'website_type_id' => 2,
37 $result = civicrm_api( 'contact','create',$params );
43 * Function returns array of result expected from previous function
45 function contact_create_expectedresult(){
47 $expectedResult = array(
55 'contact_type' => 'Individual',
56 'contact_sub_type' => '',
63 'legal_identifier' => '',
64 'external_identifier' => '',
65 'sort_name' => 'xyz3, abc3',
66 'display_name' => 'abc3 xyz3',
70 'preferred_communication_method' => '',
71 'preferred_language' => 'en_US',
72 'preferred_mail_format' => 'Both',
73 'hash' => '67eac7789eaee00',
75 'first_name' => 'abc3',
77 'last_name' => 'xyz3',
80 'email_greeting_id' => '1',
81 'email_greeting_custom' => '',
82 'email_greeting_display' => '',
83 'postal_greeting_id' => '1',
84 'postal_greeting_custom' => '',
85 'postal_greeting_display' => '',
86 'addressee_id' => '1',
87 'addressee_custom' => '',
88 'addressee_display' => '',
93 'deceased_date' => '',
94 'household_name' => '',
95 'primary_contact_id' => '',
96 'organization_name' => '',
98 'user_unique_id' => '',
99 'created_date' => '20120130621222105',
100 'modified_date' => '2012-11-14 16:02:35',
101 'api.contribution.create' => array(
110 'financial_type_id' => '1',
111 'contribution_page_id' => '',
112 'payment_instrument_id' => '1',
113 'receive_date' => '20100101000000',
114 'non_deductible_amount' => '10',
115 'total_amount' => '100',
116 'fee_amount' => '50',
117 'net_amount' => '90',
118 'trxn_id' => '12345',
119 'invoice_id' => '67890',
122 'cancel_reason' => '',
123 'receipt_date' => '',
124 'thankyou_date' => '',
126 'amount_level' => '',
127 'contribution_recur_id' => '',
128 'honor_contact_id' => '',
130 'is_pay_later' => '',
131 'contribution_status_id' => '1',
132 'honor_type_id' => '',
134 'check_number' => 'null',
136 'contribution_type_id' => '1',
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 ;
179 * This example has been generated from the API test suite. The test that created it is called
181 * testCreateIndividualWithContributionChainedArrays and can be found in
182 * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/ContactTest.php
184 * You can see the outcome of the API tests at
185 * http://tests.dev.civicrm.org/trunk/results-api_v3
187 * To Learn about the API read
188 * http://book.civicrm.org/developer/current/techniques/api/
190 * and review the wiki at
191 * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
193 * Read more about testing here
194 * http://wiki.civicrm.org/confluence/display/CRM/Testing
196 * API Standards documentation:
197 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards