executeRollback('d7_view_modes'); // Check that view modes have been rolled back. $view_mode_ids = [ 'comment.full', 'node.teaser', 'node.full', 'user.full', ]; foreach ($view_mode_ids as $view_mode_id) { $this->assertNull(EntityViewMode::load($view_mode_id)); } } /** * Executes a single rollback. * * @param string|\Drupal\migrate\Plugin\MigrationInterface $migration * The migration to rollback, or its ID. */ protected function executeRollback($migration) { if (is_string($migration)) { $this->migration = $this->getMigration($migration); } else { $this->migration = $migration; } (new MigrateExecutable($this->migration, $this))->rollback(); } }