update test generated examples
[civicrm-core.git] / api / v3 / examples / PhoneCreate.php
1 <?php
2
3 /*
4
5 */
6 function phone_create_example(){
7 $params = array(
8 'contact_id' => 3,
9 'location_type_id' => 6,
10 'phone' => '(123) 456-7890',
11 'is_primary' => 1,
12 'version' => 3,
13 'phone_type_id' => 1,
14 );
15
16 $result = civicrm_api( 'phone','create',$params );
17
18 return $result;
19 }
20
21 /*
22 * Function returns array of result expected from previous function
23 */
24 function phone_create_expectedresult(){
25
26 $expectedResult = array(
27 'is_error' => 0,
28 'version' => 3,
29 'count' => 1,
30 'id' => 1,
31 'values' => array(
32 '1' => array(
33 'id' => '1',
34 'contact_id' => '3',
35 'location_type_id' => '6',
36 'is_primary' => '1',
37 'is_billing' => '',
38 'mobile_provider_id' => '',
39 'phone' => '(123) 456-7890',
40 'phone_ext' => '',
41 'phone_numeric' => '',
42 'phone_type_id' => '1',
43 ),
44 ),
45 );
46
47 return $expectedResult ;
48 }
49
50
51 /*
52 * This example has been generated from the API test suite. The test that created it is called
53 *
54 * testCreatePhone and can be found in
55 * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/PhoneTest.php
56 *
57 * You can see the outcome of the API tests at
58 * http://tests.dev.civicrm.org/trunk/results-api_v3
59 *
60 * To Learn about the API read
61 * http://book.civicrm.org/developer/current/techniques/api/
62 *
63 * and review the wiki at
64 * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
65 *
66 * Read more about testing here
67 * http://wiki.civicrm.org/confluence/display/CRM/Testing
68 *
69 * API Standards documentation:
70 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
71 */