Merge pull request #1238 from sfe-ev/CRM-12995_amend
[civicrm-core.git] / api / v3 / examples / LocBlockCreate.php
1 <?php
2
3 /*
4
5 */
6 function loc_block_create_example(){
7 $params = array(
8 'address_id' => 2,
9 'phone_id' => 2,
10 'email_id' => 3,
11 );
12
13 $result = civicrm_api( 'loc_block','create',$params );
14
15 return $result;
16 }
17
18 /*
19 * Function returns array of result expected from previous function
20 */
21 function loc_block_create_expectedresult(){
22
23 $expectedResult = array(
24 'is_error' => 0,
25 'version' => 3,
26 'count' => 1,
27 'id' => 2,
28 'values' => array(
29 '2' => array(
30 'id' => '2',
31 'address_id' => '2',
32 'email_id' => '3',
33 'phone_id' => '2',
34 'im_id' => '',
35 'address_2_id' => '',
36 'email_2_id' => '',
37 'phone_2_id' => '',
38 'im_2_id' => '',
39 ),
40 ),
41 'xdebug' => array(
42 'peakMemory' => 145366376,
43 'memory' => 131621280,
44 'timeIndex' => '1882.6170191765',
45 ),
46 );
47
48 return $expectedResult ;
49 }
50
51
52 /*
53 * This example has been generated from the API test suite. The test that created it is called
54 *
55 * testCreateLocBlock and can be found in
56 * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/LocBlockTest.php
57 *
58 * You can see the outcome of the API tests at
59 * http://tests.dev.civicrm.org/trunk/results-api_v3
60 *
61 * To Learn about the API read
62 * http://book.civicrm.org/developer/current/techniques/api/
63 *
64 * and review the wiki at
65 * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
66 *
67 * Read more about testing here
68 * http://wiki.civicrm.org/confluence/display/CRM/Testing
69 *
70 * API Standards documentation:
71 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
72 */