You are here

public function CsvParserTest::csvFileProvider in Feeds 8.3

Data provider for testCsvParsing().

File

tests/src/Unit/Component/CsvParserTest.php, line 148

Class

CsvParserTest
@coversDefaultClass \Drupal\feeds\Component\CsvParser @group feeds

Namespace

Drupal\Tests\feeds\Unit\Component

Code

public function csvFileProvider() {
  $path = dirname(dirname(dirname(dirname(__DIR__)))) . '/tests/resources/csv-parser-component-files';
  $return = [];
  foreach (glob($path . '/csv/*.csv') as $file) {
    $json_file = $path . '/json/' . str_replace('.csv', '.json', basename($file));
    $return[] = [
      $file,
      json_decode(file_get_contents($json_file), TRUE),
    ];
  }
  return $return;
}