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