You are here

public function CSVUnitTest::testConfigurableCsvFileObject in Migrate Source CSV 8.2

Tests configurable CSV file object.

@covers ::__construct

File

tests/src/Unit/Plugin/migrate/source/CSVUnitTest.php, line 314

Class

CSVUnitTest
@coversDefaultClass \Drupal\migrate_source_csv\Plugin\migrate\source\CSV

Namespace

Drupal\Tests\migrate_source_csv\Unit\Plugin\migrate\source

Code

public function testConfigurableCsvFileObject() {
  $configuration = [
    'path' => $this->happyPath,
    'keys' => [
      'id',
    ],
    'header_row_count' => 1,
    'file_class' => FooCSVFileObject::class,
  ];
  $csv = new CSV($configuration, $this->pluginId, $this->pluginDefinition, $this->migration);
  $csv
    ->initializeIterator();
  $fileObject = $this
    ->readAttribute($csv, 'file');
  $this
    ->assertInstanceOf(FooCSVFileObject::class, $fileObject);
}