public function CSVUnitTest::fieldsDataProvider in Migrate Source CSV 8.3
Data provider for fields testing.
Return value
array The test case.
File
- tests/
src/ Unit/ Plugin/ migrate/ source/ CSVUnitTest.php, line 368
Class
- CSVUnitTest
- @coversDefaultClass \Drupal\migrate_source_csv\Plugin\migrate\source\CSV
Namespace
Drupal\Tests\migrate_source_csv\Unit\Plugin\migrate\sourceCode
public function fieldsDataProvider() : array {
$data['no fields'] = [
'configuration' => [
'ids' => [
'id',
],
],
'expected' => [
'id' => 'id',
'first_name' => 'first_name',
'last_name' => 'last_name',
'email' => 'email',
'country' => 'country',
'ip_address' => 'ip_address',
],
];
$data['with fields override'] = [
'configuration' => [
'ids' => [
'id',
],
'fields' => [
[
'name' => 'id',
],
[
'name' => 'first_name',
'label' => 'First Name',
],
],
],
'expected' => [
'id' => 'id',
'first_name' => 'First Name',
],
];
return $data;
}