public function testCsvSingleFileByFilenameFetcherManipulator() { $settings = array('FETCHER' => array('input_file' => dirname(__FILE__) . '/assets/csv/sample_metadata.csv', 'temp_directory' => $this->path_to_temp_dir, 'record_key' => 'ID', 'use_cache' => false), 'LOGGING' => array('path_to_log' => $this->path_to_log, 'path_to_manipulator_log' => ''), 'FILE_GETTER' => array('file_name_field' => 'File'), 'MANIPULATORS' => array('fetchermanipulators' => array('CsvSingleFileByFilename|postcard_1'))); $csv = new Csv($settings); $records = $csv->getRecords(); $this->assertCount(10, $records, "CsvSingleFileByFilename manipulator did not work"); }
public function testGetRecords() { // We define settings here, not in a settings file. $settings = array('FETCHER' => array('input_file' => dirname(__FILE__) . '/assets/test.csv')); $a = new Csv($settings); $records = $a->getRecords(); $this->assertCount(3, $records); }
public function testGetRecords() { // Define settings here, not in a configuration file. $settings = array('FETCHER' => array('input_file' => dirname(__FILE__) . '/assets/csv/sample_metadata.csv', 'temp_directory' => $this->path_to_temp_dir, 'record_key' => 'ID'), 'LOGGING' => array('path_to_log' => $this->path_to_log)); $csv = new Csv($settings); $records = $csv->getRecords(); $this->assertCount(20, $records); }