You are here

public function FieldTest::testFields in Commerce Migrate 3.1.x

Same name in this branch
  1. 3.1.x modules/ubercart/tests/src/Kernel/Migrate/uc7/FieldTest.php \Drupal\Tests\commerce_migrate_ubercart\Kernel\Migrate\uc7\FieldTest::testFields()
  2. 3.1.x modules/ubercart/tests/src/Kernel/Migrate/uc6/FieldTest.php \Drupal\Tests\commerce_migrate_ubercart\Kernel\Migrate\uc6\FieldTest::testFields()
Same name and namespace in other branches
  1. 8.2 modules/ubercart/tests/src/Kernel/Migrate/uc7/FieldTest.php \Drupal\Tests\commerce_migrate_ubercart\Kernel\Migrate\uc7\FieldTest::testFields()
  2. 3.0.x modules/ubercart/tests/src/Kernel/Migrate/uc7/FieldTest.php \Drupal\Tests\commerce_migrate_ubercart\Kernel\Migrate\uc7\FieldTest::testFields()

Tests the Ubercart 7 field to Drupal 8 migration.

File

modules/ubercart/tests/src/Kernel/Migrate/uc7/FieldTest.php, line 45

Class

FieldTest
Tests migration of Ubercart 7 fields.

Namespace

Drupal\Tests\commerce_migrate_ubercart\Kernel\Migrate\uc7

Code

public function testFields() {
  $field_storages = [
    'commerce_product.body',
    'commerce_product.field_number',
    'commerce_product.field_sustainability',
    'commerce_product.taxonomy_catalog',
    'commerce_product.uc_product_image',
    'node.body',
    'node.field_image',
    'node.field_number',
    'node.field_tags',
    'taxonomy_term.uc_catalog_image',
  ];
  foreach ($field_storages as $field_storage) {

    /** @var \Drupal\field\Entity\FieldStorageConfig $storage */
    $storage = FieldStorageConfig::load($field_storage);
    $this
      ->assertInstanceOf(FieldStorageConfig::class, $storage, "{$field_storage} is not an instance of FieldStorageConfig");
  }
  $storage = FieldStorageConfig::load('node.field_sustainability');
  $this
    ->assertNull($storage);
  $storage = FieldStorageConfig::load('node.uc_product_image');
  $this
    ->assertNull($storage);
}