Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | <?php |
2 | ||
3 | /* | |
4 | ||
5 | */ | |
6 | function grant_get_example(){ | |
7 | $params = array( | |
8 | 'version' => 3, | |
22fd1690 | 9 | 'contact_id' => 3, |
6a488035 TO |
10 | 'application_received_date' => 'now', |
11 | 'decision_date' => 'next Monday', | |
12 | 'amount_total' => '500', | |
13 | 'status_id' => 1, | |
14 | 'rationale' => 'Just Because', | |
15 | 'currency' => 'USD', | |
16 | 'grant_type_id' => 1, | |
17 | ); | |
18 | ||
19 | $result = civicrm_api( 'grant','get',$params ); | |
20 | ||
21 | return $result; | |
22 | } | |
23 | ||
24 | /* | |
25 | * Function returns array of result expected from previous function | |
26 | */ | |
27 | function grant_get_expectedresult(){ | |
28 | ||
29 | $expectedResult = array( | |
30 | 'is_error' => 0, | |
31 | 'version' => 3, | |
32 | 'count' => 1, | |
22fd1690 | 33 | 'id' => 1, |
6a488035 | 34 | 'values' => array( |
22fd1690 ARW |
35 | '1' => array( |
36 | 'id' => '1', | |
37 | 'contact_id' => '3', | |
38 | 'application_received_date' => '2013-05-14', | |
39 | 'decision_date' => '2013-05-20', | |
6a488035 TO |
40 | 'grant_type_id' => '1', |
41 | 'amount_total' => '500.00', | |
42 | 'currency' => 'USD', | |
43 | 'rationale' => 'Just Because', | |
44 | 'status_id' => '1', | |
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 | * testGetGrant and can be found in | |
57 | * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/GrantTest.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 | */ |