only in patch2: unchanged: --- a/core/modules/migrate/src/Tests/MigrateRollbackTest.php +++ b/core/modules/migrate/src/Tests/MigrateRollbackTest.php @@ -111,15 +111,14 @@ public function testRollback() { $this->assertTrue($term_migration->getDestinationPlugin()->supportsRollback()); + // Pre-create a term, to make sure it isn't deleted on rollback. + $preserved_term_id = 1; + $new_term = Term::create(['tid' => $preserved_term_id, 'vid' => 1, 'name' => 'music']); + $new_term->save(); + // Import and validate term entities were created. $term_executable = new MigrateExecutable($term_migration, $this); $term_executable->import(); - // Mark one row to be preserved on rollback. - $preserved_term_id = 2; - $map_row = $term_id_map->getRowBySource(['id' => $preserved_term_id]); - $dummy_row = new Row(['id' => $preserved_term_id], $ids); - $term_id_map->saveIdMapping($dummy_row, [$map_row['destid1']], - $map_row['source_row_status'], MigrateIdMapInterface::ROLLBACK_PRESERVE); foreach ($term_data_rows as $row) { /** @var Term $term */ $term = Term::load($row['id']);