protected function MigrationTestTrait::execute in Workbench Moderation to Content Moderation 8.2
Executes a migration step for a particular entity type.
Parameters
string $entity_type_id: The entity type ID.
string $step: Which step to execute. Can be one of 'save', 'clear', or 'restore'.
Return value
\Drupal\migrate\Plugin\MigrationInterface The executed migration.
3 calls to MigrationTestTrait::execute()
- TestBase::doMigration in tests/
src/ Functional/ TestBase.php - Migrates from Workbench Moderation to Content Moderation.
- TestBase::testClear in tests/
src/ Kernel/ Migration/ TestBase.php - Tests that moderation states are correctly cleared.
- TestBase::testRestore in tests/
src/ Kernel/ Migration/ TestBase.php - Tests that moderation states are properly restored.
File
- tests/
src/ Kernel/ MigrationTestTrait.php, line 93
Class
Namespace
Drupal\Tests\wbm2cm\KernelCode
protected function execute($entity_type_id, $step) {
$migration_id = "wbm2cm_{$step}:{$entity_type_id}";
$migration = $this->container
->get('plugin.manager.migration')
->createInstance($migration_id);
$executable = new MigrateExecutable($migration, new MigrateMessage());
$executable
->import();
return $migration;
}