CRM-13072 further tweak on example formatter
[civicrm-core.git] / api / v3 / examples / ParticipantCreate.php
CommitLineData
6a488035
TO
1<?php
2
3/*
4
5 */
6function participant_create_example(){
53ca8fd7 7$params = array(
6a488035
TO
8 'contact_id' => 4,
9 'event_id' => 1,
10 'status_id' => 1,
11 'role_id' => 1,
12 'register_date' => '2007-07-21 00:00:00',
13 'source' => 'Online Event Registration: API Testing',
14 'version' => 3,
15 'custom_1' => 'custom string',
16);
17
18 $result = civicrm_api( 'participant','create',$params );
19
20 return $result;
21}
22
23/*
24 * Function returns array of result expected from previous function
25 */
26function participant_create_expectedresult(){
27
53ca8fd7 28 $expectedResult = array(
6a488035
TO
29 'is_error' => 0,
30 'version' => 3,
31 'count' => 1,
32 'id' => 4,
53ca8fd7 33 'values' => array(
34 '4' => array(
6a488035
TO
35 'id' => '4',
36 'contact_id' => '4',
37 'event_id' => '1',
38 'status_id' => '1',
39 'role_id' => '1',
40 'register_date' => '20070721000000',
41 'source' => 'Online Event Registration: API Testing',
42 'fee_level' => '',
43 'is_test' => '',
44 'is_pay_later' => '',
45 'fee_amount' => '',
46 'registered_by_id' => '',
47 'discount_id' => '',
48 'fee_currency' => '',
49 'campaign_id' => '',
50 'discount_amount' => '',
51 'cart_id' => '',
52 'must_wait' => '',
53 ),
54 ),
55);
56
57 return $expectedResult ;
58}
59
60
61/*
62* This example has been generated from the API test suite. The test that created it is called
63*
64* testCreateWithCustom and can be found in
65* http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/ParticipantTest.php
66*
67* You can see the outcome of the API tests at
68* http://tests.dev.civicrm.org/trunk/results-api_v3
69*
70* To Learn about the API read
71* http://book.civicrm.org/developer/current/techniques/api/
72*
73* and review the wiki at
74* http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
75*
76* Read more about testing here
77* http://wiki.civicrm.org/confluence/display/CRM/Testing
78*
79* API Standards documentation:
80* http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
81*/