<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.3 |
+ | CiviCRM version 4.4 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2013 |
+--------------------------------------------------------------------+
}
function tearDown() {
+ // TODO Figure out how to automatically drop all temporary tables.
+ // Note that MySQL doesn't provide a way to list them, so we would need
+ // to keep track ourselves (eg CRM_Core_TemporaryTableManager) or reset
+ // the MySQL connection between test runs.
parent::tearDown();
}
$config = CRM_Core_Config::singleton();
$config->keyDisable = TRUE;
$controller = new CRM_Core_Controller_Simple($reportClass, ts('some title'));
- $reportObj =& $controller->_pages['Detail']; //FIXME - Detail is going to change
+ $tmpReportVal = explode('_', $reportClass);
+ $reportName = array_pop($tmpReportVal);
+ $reportObj =& $controller->_pages[$reportName];
$tmpGlobals = array();
$tmpGlobals['_REQUEST']['force'] = 1;
$tmpGlobals['_GET'][$key] = $val;
}
}
+ if (!empty($inputParams['group_bys'])) {
+ $groupByFields = implode(' ', $inputParams['group_bys']);
+ $tmpGlobals['_GET']['gby'] = $groupByFields;
+ }
+
CRM_Utils_GlobalStack::singleton()->push($tmpGlobals);
try {
$csvContent = CRM_Report_Utils_Report::makeCsv($reportObj, $rows);
file_put_contents($tmpFile, $csvContent);
} catch (Exception $e) {
+ // print_r($e->getCause()->getUserInfo());
CRM_Utils_GlobalStack::singleton()->pop();
throw $e;
}