You are here

public function DrushWithMigrateUpgradeFromFileTest::assertD7FieldMigration in Media Migration 8

Tests the Drupal 7 field storage migration.

Parameters

\Drupal\migrate_plus\Entity\MigrationInterface $d7_field_migration: The Drupal 7 field storage migration entity.

1 call to DrushWithMigrateUpgradeFromFileTest::assertD7FieldMigration()
DrushWithMigrateUpgradeFromFileTest::testMigrationWithDrush in tests/src/Functional/DrushWithMigrateUpgradeFromFileTest.php
Tests migrations with Migrate Upgrade, Drush and Migrate Tools.

File

tests/src/Functional/DrushWithMigrateUpgradeFromFileTest.php, line 171

Class

DrushWithMigrateUpgradeFromFileTest
Tests Migrate Upgrade compatibility and verifies usage steps of README.

Namespace

Drupal\Tests\media_migration\Functional

Code

public function assertD7FieldMigration(MigrationEntityInterface $d7_field_migration) {
  $this
    ->assertEquals([
    'id' => 'upgrade_d7_field',
    'migration_group' => 'migrate_drupal_7',
    'migration_tags' => [
      'Drupal 7',
      'Configuration',
    ],
    'source' => [
      'plugin' => 'd7_field',
      'constants' => [
        'status' => TRUE,
        'langcode' => 'und',
      ],
      'mapMigrationProcessValueToMedia' => TRUE,
    ],
    'process' => [
      'entity_type' => [
        [
          'plugin' => 'get',
          'source' => 'entity_type',
        ],
        [
          'plugin' => 'static_map',
          'map' => [
            'file' => 'media',
          ],
          'bypass' => TRUE,
        ],
      ],
      'status' => [
        [
          'plugin' => 'get',
          'source' => 'constants/status',
        ],
      ],
      'langcode' => [
        [
          'plugin' => 'get',
          'source' => 'constants/langcode',
        ],
      ],
      'field_name' => [
        [
          'plugin' => 'get',
          'source' => 'field_name',
        ],
      ],
      'type' => [
        [
          'plugin' => 'process_field',
          'source' => 'type',
          'method' => 'getFieldType',
          'map' => [
            'd7_text' => [
              'd7_text' => 'd7_text',
            ],
            'media_image' => [
              'media_image' => 'media_image',
            ],
            'file_entity' => [
              'file_entity' => 'file_entity',
            ],
          ],
        ],
      ],
      'cardinality' => [
        [
          'plugin' => 'get',
          'source' => 'cardinality',
        ],
      ],
      'settings' => [
        0 => [
          'plugin' => 'd7_field_settings',
        ],
        'media_image' => [
          'plugin' => 'media_image_field_settings',
        ],
        'file_entity' => [
          'plugin' => 'file_entity_field_settings',
        ],
      ],
    ],
    'destination' => [
      'plugin' => 'entity:field_storage_config',
    ],
    'migration_dependencies' => [
      'required' => [],
      'optional' => [],
    ],
    'dependencies' => [],
  ], $this
    ->getImportantEntityProperties($d7_field_migration));
}