/** * @dataProvider getReadersNoHeadersFirstRow */ public function testSetHeaderLineNoHeadersFirstRow(Reader $reader) { // set headers $reader->setHeaderLine(3); $this->assertEquals($this->headerValues, $reader->getHeaders()); $rows = $reader->getAll(); $this->assertCount(5, $rows); $this->assertEquals($this->expectedRows, $rows); }
*/ $results_dir = CKANMNGR_RESULTS_DIR . date('/Ymd') . '_COMPARE_BASIC'; if (!is_dir($results_dir)) { mkdir($results_dir); } echo 'cmp1.csv' . PHP_EOL; if (!is_file($results_dir . '/cmp1.csv')) { $cmp1_csv = new Writer($results_dir . '/cmp1.csv'); $cmp1_csv->writeRow(['title', 'title_simple', 'name', 'url', 'identifier', 'guid', 'topics', 'categories']); $CkanManager = new CkanManager(CKAN_API_URL); $CkanManager->resultsDir = $results_dir; $cmp1 = $CkanManager->exportBrief('organization:((eop-gov) OR (omb-eop-gov) OR (ondcp-eop-gov) OR (ceq-eop-gov) ' . 'OR (ostp-eop-gov) OR (ustr-eop-gov) OR (wh-eop-gov)) DMS AND dataset_type:dataset'); $cmp1_csv->writeFromArray($cmp1); } else { $cmp1_csv = new Reader($results_dir . '/cmp1.csv'); $cmp1_csv->getHeaders(); $cmp1 = $cmp1_csv->getAll(); } echo 'cmp2.csv' . PHP_EOL; if (!is_file($results_dir . '/cmp2.csv')) { $cmp2_csv = new Writer($results_dir . '/cmp2.csv'); $cmp2_csv->writeRow(['title', 'title_simple', 'name', 'url', 'identifier', 'guid', 'topics', 'categories']); $CkanManager = new CkanManager(CKAN_API_URL); $CkanManager->resultsDir = $results_dir; $cmp2 = $CkanManager->exportBrief('organization:((eop-gov) OR (omb-eop-gov) OR (ondcp-eop-gov) OR (ceq-eop-gov) ' . 'OR (ostp-eop-gov) OR (ustr-eop-gov) OR (wh-eop-gov)) -DMS AND dataset_type:dataset'); $cmp2_csv->writeFromArray($cmp2); } else { $cmp2_csv = new Reader($results_dir . '/cmp2.csv'); $cmp2 = $cmp2_csv->getAll(); } $cmp2_by_title = $cmp2_by_guid = [];