3 * Test Generated example of using report_template getrows API
4 * Retrieve rows from a report template (optionally providing the instance_id) *
6 function report_template_getrows_example(){
8 'report_id' => 'contact/summary',
18 $result = civicrm_api3('report_template', 'getrows', $params);
20 catch (CiviCRM_API3_Exception
$e) {
22 $errorMessage = $e->getMessage();
23 $errorCode = $e->getErrorCode();
24 $errorData = $e->getExtraParams();
25 return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
32 * Function returns array of result expected from previous function
34 function report_template_getrows_expectedresult(){
36 $expectedResult = array(
42 'civicrm_contact_sort_name' => 'Default Organization',
43 'civicrm_contact_id' => '1',
44 'civicrm_address_street_address' => '',
45 'civicrm_address_city' => '',
46 'civicrm_country_name' => '',
49 'civicrm_contact_sort_name' => 'Second Domain',
50 'civicrm_contact_id' => '2',
51 'civicrm_address_street_address' => '15 Main St',
52 'civicrm_address_city' => 'Collinsville',
53 'civicrm_country_name' => 'United States',
57 'title' => 'ERROR: Title is not Set',
59 'civicrm_contact_sort_name' => 'Contact Name',
60 'civicrm_contact_id' => 'Internal Contact ID',
61 'civicrm_address_street_address' => 'Street Address',
62 'civicrm_address_city' => 'City',
63 'civicrm_country_name' => 'Country',
68 return $expectedResult;
73 * This example has been generated from the API test suite. The test that created it is called
75 * testReportTemplateGetRowsContactSummary and can be found in
76 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ReportTemplateTest.php
78 * You can see the outcome of the API tests at
79 * https://test.civicrm.org/job/CiviCRM-master-git/
81 * To Learn about the API read
82 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
84 * Browse the api on your own site with the api explorer
85 * http://MYSITE.ORG/path/to/civicrm/api/explorer
87 * Read more about testing here
88 * http://wiki.civicrm.org/confluence/display/CRM/Testing
90 * API Standards documentation:
91 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards