Convert test
authoreileen <emcnaughton@wikimedia.org>
Sun, 28 Jul 2019 14:59:12 +0000 (02:59 +1200)
committereileen <emcnaughton@wikimedia.org>
Fri, 2 Aug 2019 20:40:07 +0000 (08:40 +1200)
tests/phpunit/CRM/Export/BAO/ExportTest.php

index 36e76e5911a25ea3ef5e28167588c8fd8f3365ed..17160761396ad1943ea7c84e50577318609380ea 100644 (file)
@@ -1765,6 +1765,8 @@ class CRM_Export_BAO_ExportTest extends CiviUnitTestCase {
    * @param array $expectedHeaders
    *
    * @throws \CRM_Core_Exception
+   * @throws \League\Csv\Exception
+   *
    * @dataProvider getSqlColumnsOutput
    */
   public function testGetSQLColumnsAndHeaders($exportMode, $expected, $expectedHeaders) {
@@ -1774,25 +1776,9 @@ class CRM_Export_BAO_ExportTest extends CiviUnitTestCase {
     // eventually aspire to call $provider->getSQLColumns straight after it
     // is intiated.
     $this->setupBaseExportData($exportMode);
-
-    $result = CRM_Export_BAO_Export::exportComponents(
-      TRUE,
-      [1],
-      [],
-      NULL,
-      NULL,
-      NULL,
-      $exportMode,
-      NULL,
-      NULL,
-      FALSE,
-      FALSE,
-      [
-        'suppress_csv_for_testing' => TRUE,
-      ]
-    );
-    $this->assertEquals($expected, $result[1]);
-    $this->assertEquals($expectedHeaders, $result[2]);
+    $this->doExportTest(['selectAll' => TRUE, 'exportMode' => $exportMode, 'ids' => [1]]);
+    $this->assertEquals($expected, $this->processor->getSQLColumns());
+    $this->assertEquals($expectedHeaders, $this->processor->getHeaderRows());
   }
 
   /**