You are here

public function ParagraphContentMigrationTest::testParagraphContentMigration in Paragraphs 8

Tests the migration of a content with paragraphs and field collections.

@dataProvider providerParagraphContentMigration

File

tests/src/Kernel/migrate/ParagraphContentMigrationTest.php, line 76

Class

ParagraphContentMigrationTest
Test 'classic' Paragraph content migration.

Namespace

Drupal\Tests\paragraphs\Kernel\migrate

Code

public function testParagraphContentMigration($migration_to_run) {
  if ($migration_to_run) {

    // Drupal 8.8.x only has 'classic' node migrations.
    // @see https://www.drupal.org/node/3105503
    if (strpos($migration_to_run, 'd7_node_complete') === 0 && version_compare(\Drupal::VERSION, '8.9', '<')) {
      $this
        ->pass("Drupal 8.8.x has only the 'classic' node migration.");
      return;
    }
    $this
      ->executeMigration($migration_to_run);
  }
  $this
    ->assertNode8Paragraphs();
  $this
    ->assertNode9Paragraphs();
  $node_9 = Node::load(9);
  if ($node_9 instanceof TranslatableInterface && !empty($node_9
    ->getTranslationLanguages(FALSE))) {
    $this
      ->assertIcelandicNode9Paragraphs();
  }
}