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