You are here

public function CSVUnitTest::testGetIdsComplex in Migrate Source CSV 8.2

Tests that the key is properly identified.

@covers ::getIds

File

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

Class

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

Namespace

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

Code

public function testGetIdsComplex() {

  // @codingStandardsIgnoreStart
  $configuration = [
    'path' => $this->happyPath,
    'keys' => [
      'id',
      'paragraph' => [
        'type' => 'text',
        'size' => 'big',
      ],
    ],
    'header_row_count' => 1,
  ];

  // @codingStandardsIgnoreEnd
  $csv = new CSV($configuration, $this->pluginId, $this->pluginDefinition, $this->migration);
  $expected = [
    'id' => [
      'type' => 'string',
    ],
    'paragraph' => [
      'type' => 'text',
      'size' => 'big',
    ],
  ];
  $this
    ->assertArrayEquals($expected, $csv
    ->getIds());
}