You are here

protected function ParagraphsMigrationTestBase::prepareMigration in Paragraphs 8

Modify a migration's configuration before executing it.

Parameters

\Drupal\migrate\Plugin\MigrationInterface $migration: The migration to execute.

Overrides MigrateTestBase::prepareMigration

File

tests/src/Kernel/migrate/ParagraphsMigrationTestBase.php, line 131

Class

ParagraphsMigrationTestBase
Base class for the paragraph migrations tests.

Namespace

Drupal\Tests\paragraphs\Kernel\migrate

Code

protected function prepareMigration(MigrationInterface $migration) {

  // We want to run the revision migration without running all the node
  // migrations.
  if ($migration
    ->id() == 'd7_node_revision:paragraphs_test') {
    $migration
      ->set('migration_dependencies', [
      'required' => [
        'd7_node:paragraphs_test',
      ],
      'optional' => [],
    ]);
    $migration
      ->set('requirements', [
      'd7_node:paragraphs_test' => 'd7_node:paragraphs_test',
    ]);
  }
}