You are here

public function MigrateTableTest::tableDestinationMigration in Migrate Plus 8.5

Create a minimally valid migration with some source data.

Return value

array The migration definition.

File

tests/src/Kernel/MigrateTableTest.php, line 113

Class

MigrateTableTest
Tests migration destination table.

Namespace

Drupal\Tests\migrate_plus\Kernel

Code

public function tableDestinationMigration() {
  return [
    'dummy table' => [
      [
        'id' => 'migration_table_test',
        'migration_tags' => [
          'Testing',
        ],
        'source' => [
          'plugin' => 'embedded_data',
          'data_rows' => [
            [
              'data' => 'dummy1 value1',
              'data2' => 'dummy2 value1',
            ],
            [
              'data' => 'dummy1 value2',
              'data2' => 'dummy2 value2',
            ],
            [
              'data' => 'dummy1 value3',
              'data2' => 'dummy2 value3',
            ],
          ],
          'ids' => [
            'data' => [
              'type' => 'string',
            ],
          ],
        ],
        'destination' => [
          'plugin' => 'table',
          'table_name' => static::DEST_TABLE_NAME,
          'id_fields' => [
            'data' => [
              'type' => 'string',
            ],
          ],
        ],
        'process' => [
          'data' => 'data',
          'data2' => 'data2',
        ],
      ],
    ],
  ];
}