3 * Test Generated example of using report_template getstatistics API.
5 * Get Statistics from a report (note there isn't much data to get in the test DB).
10 function report_template_getstatistics_example() {
12 'report_id' => 'contribute/recur',
16 $result = civicrm_api3('report_template', 'getstatistics', $params);
18 catch (CiviCRM_API3_Exception
$e) {
20 $errorMessage = $e->getMessage();
21 $errorCode = $e->getErrorCode();
22 $errorData = $e->getExtraParams();
24 'error' => $errorMessage,
25 'error_code' => $errorCode,
26 'error_data' => $errorData,
34 * Function returns array of result expected from previous function.
39 function report_template_getstatistics_expectedresult() {
41 $expectedResult = array(
48 'title' => 'Row(s) Listed',
56 return $expectedResult;
60 * This example has been generated from the API test suite.
61 * The test that created it is called
62 * testReportTemplateGetStatisticsAllReports
64 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ReportTemplateTest.php
66 * You can see the outcome of the API tests at
67 * https://test.civicrm.org/job/CiviCRM-master-git/
69 * To Learn about the API read
70 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
72 * Browse the api on your own site with the api explorer
73 * http://MYSITE.ORG/path/to/civicrm/api
75 * Read more about testing here
76 * http://wiki.civicrm.org/confluence/display/CRM/Testing
78 * API Standards documentation:
79 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards