From 295549b437f7e46e0538bd5b63b300d2eac12910 Mon Sep 17 00:00:00 2001 From: eileen Date: Wed, 10 Jul 2019 00:19:15 +1200 Subject: [PATCH] Update export test to new function --- tests/phpunit/CRM/Export/BAO/ExportTest.php | 30 +++++++-------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/tests/phpunit/CRM/Export/BAO/ExportTest.php b/tests/phpunit/CRM/Export/BAO/ExportTest.php index c45e61056f..66b4095162 100644 --- a/tests/phpunit/CRM/Export/BAO/ExportTest.php +++ b/tests/phpunit/CRM/Export/BAO/ExportTest.php @@ -92,6 +92,8 @@ class CRM_Export_BAO_ExportTest extends CiviUnitTestCase { /** * Basic test to ensure the exportComponents function can export selected fields for contribution. + * + * @throws \CRM_Core_Exception */ public function testExportComponentsContribution() { $this->setUpContributionExportData(); @@ -107,27 +109,13 @@ class CRM_Export_BAO_ExportTest extends CiviUnitTestCase { ['Contribution', 'trxn_id'], ]; - list($tableName) = CRM_Export_BAO_Export::exportComponents( - TRUE, - $this->contributionIDs, - [], - 'receive_date desc', - $selectedFields, - NULL, - CRM_Export_Form_Select::CONTRIBUTE_EXPORT, - 'civicrm_contribution.id IN ( ' . implode(',', $this->contributionIDs) . ')', - NULL, - FALSE, - FALSE, - [ - 'exportOption' => CRM_Export_Form_Select::CONTRIBUTE_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); + $this->doExportTest([ + 'ids' => $this->contributionIDs, + 'order' => 'receive_date desc', + 'fields' => $selectedFields, + 'exportMode' => CRM_Export_Form_Select::CONTRIBUTE_EXPORT, + 'componentClause' => 'civicrm_contribution.id IN ( ' . implode(',', $this->contributionIDs) . ')', + ]); } /** -- 2.25.1