'ids' =>
[ 'data' =>
['type' => 'string'
],
],
],
'process' =>
['value' => 'data'
],
'destination' =>
['plugin' => 'dummy'
],
];
$migration = \Drupal::
service('plugin.manager.migration'
)->
createStubMigration($definition);
$executable =
new MigrateExecutable($migration);
// As the import runs, events will be dispatched, recording the received
// information in state.
$executable->
import();
// Validate from the recorded state that the events were received.
$event =
$this->state->
get('migrate_events_test.pre_import_event',
[]);
$this->
assertSame(MigrateEvents::PRE_IMPORT,
$event['event_name'
]);
$this->
assertSame($migration->
id(),
$event['migration'
]->
id());
$event =
$this->state->
get('migrate_events_test.post_import_event',
[]);
$this->
assertSame(MigrateEvents::POST_IMPORT,
$event['event_name'
]);