You are here

public function CSVUnitTest::testGetFile in Migrate Source CSV 8.2

Test the getFile return a valid file instance.

@covers ::getFile

File

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

Class

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

Namespace

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

Code

public function testGetFile() {
  $configuration = [
    'path' => $this->happyPath,
    'keys' => [
      'id',
    ],
    'header_row_count' => 1,
  ];
  $csv = new CSV($configuration, $this->pluginId, $this->pluginDefinition, $this->migration);
  $csv
    ->initializeIterator();
  $file = $csv
    ->getFile();
  $this
    ->assertInstanceOf(\SplFileObject::class, $file);
}