+
+ /**
+ * Basic test to ensure the exportComponents function can export selected fields for contribution.
+ */
+ public function testExportComponentsActivity() {
+ $this->setUpActivityExportData();
+ $selectedFields = array(
+ array('Individual', 'display_name'),
+ array('Individual', '5_a_b', 'display_name'),
+ );
+
+ list($tableName) = CRM_Export_BAO_Export::exportComponents(
+ FALSE,
+ $this->activityIDs,
+ array(),
+ '`activity_date_time` desc',
+ $selectedFields,
+ NULL,
+ CRM_Export_Form_Select::ACTIVITY_EXPORT,
+ 'civicrm_activity.id IN ( ' . implode(',', $this->activityIDs) . ')',
+ NULL,
+ FALSE,
+ FALSE,
+ array(
+ 'exportOption' => CRM_Export_Form_Select::ACTIVITY_EXPORT,
+ 'suppress_csv_for_testing' => TRUE,
+ )
+ );
+
+ // delete the export temp table and component table
+ $sql = "DROP TABLE IF EXISTS {$tableName}";
+ CRM_Core_DAO::executeQuery($sql);
+ }
+