You are here

public function CSVTest::getIds in Migrate Source CSV 8

Tests that the key is properly identified.

@test

@covers ::getIds

File

tests/src/Unit/Plugin/migrate/source/CSVTest.php, line 223
Code for CSVTest.php.

Class

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

Namespace

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

Code

public function getIds() {
  $configuration = [
    'path' => $this->happyPath,
    'keys' => [
      'id',
    ],
    'header_row_count' => 1,
  ];
  $csv = new CSV($configuration, $this->pluginId, $this->pluginDefinition, $this->plugin);
  $expected = [
    'id' => [
      'type' => 'string',
    ],
  ];
  $this
    ->assertArrayEquals($expected, $csv
    ->getIds());
}