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