update test generated examples
[civicrm-core.git] / api / v3 / examples / PriceFieldCreate.php
CommitLineData
6a488035
TO
1<?php
2
3/*
4
5 */
6function price_field_create_example(){
7$params = array(
8 'version' => 3,
9 'price_set_id' => 3,
10 'name' => 'grassvariety',
11 'label' => 'Grass Variety',
12 'html_type' => 'Text',
13 'is_enter_qty' => 1,
14 'is_active' => 1,
15);
16
17 $result = civicrm_api( 'price_field','create',$params );
18
19 return $result;
20}
21
22/*
23 * Function returns array of result expected from previous function
24 */
25function price_field_create_expectedresult(){
26
27 $expectedResult = array(
28 'is_error' => 0,
29 'version' => 3,
30 'count' => 1,
31 'id' => 2,
32 'values' => array(
33 '2' => array(
34 'id' => '2',
35 'price_set_id' => '3',
36 'name' => 'grassvariety',
37 'label' => 'Grass Variety',
38 'html_type' => 'Text',
39 'is_enter_qty' => '1',
40 'help_pre' => '',
41 'help_post' => '',
42 'weight' => '',
43 'is_display_amounts' => '',
44 'options_per_line' => '',
45 'is_active' => '1',
46 'is_required' => '',
47 'active_on' => '',
48 'expire_on' => '',
49 'javascript' => '',
50 'visibility_id' => '',
51 ),
52 ),
53);
54
55 return $expectedResult ;
56}
57
58
59/*
60* This example has been generated from the API test suite. The test that created it is called
61*
62* testCreatePriceField and can be found in
63* http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/PriceFieldTest.php
64*
65* You can see the outcome of the API tests at
66* http://tests.dev.civicrm.org/trunk/results-api_v3
67*
68* To Learn about the API read
69* http://book.civicrm.org/developer/current/techniques/api/
70*
71* and review the wiki at
72* http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
73*
74* Read more about testing here
75* http://wiki.civicrm.org/confluence/display/CRM/Testing
76*
77* API Standards documentation:
78* http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
79*/