Merge remote-tracking branch 'upstream/4.3' into 4.3-master-2013-07-14-22-39-05
[civicrm-core.git] / api / v3 / examples / PriceSetGet.php
CommitLineData
6a488035
TO
1<?php
2
3/*
4
5 */
6function price_set_get_example(){
53ca8fd7 7$params = array(
6a488035
TO
8 'version' => 3,
9 'name' => 'default_contribution_amount',
10);
11
12 $result = civicrm_api( 'price_set','get',$params );
13
14 return $result;
15}
16
17/*
18 * Function returns array of result expected from previous function
19 */
20function price_set_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 'name' => 'default_contribution_amount',
31 'title' => 'Contribution Amount',
32 'is_active' => '1',
33 'extends' => '2',
34 'is_quick_config' => '1',
35 'is_reserved' => '1',
36 'entity' => array(),
37 ),
38 ),
39);
40
41 return $expectedResult ;
42}
43
44
45/*
46* This example has been generated from the API test suite. The test that created it is called
47*
48* testGetBasicPriceSet and can be found in
49* http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/PriceSetTest.php
50*
51* You can see the outcome of the API tests at
52* http://tests.dev.civicrm.org/trunk/results-api_v3
53*
54* To Learn about the API read
55* http://book.civicrm.org/developer/current/techniques/api/
56*
57* and review the wiki at
58* http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
59*
60* Read more about testing here
61* http://wiki.civicrm.org/confluence/display/CRM/Testing
62*
63* API Standards documentation:
64* http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
65*/