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