You are here

public function FieldFormatterSettingsTest::testEntityDisplaySettings in Commerce Migrate 3.0.x

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

Test that product entity display are migrated to product entities.

File

modules/ubercart/tests/src/Kernel/Migrate/uc7/FieldFormatterSettingsTest.php, line 94

Class

FieldFormatterSettingsTest
Tests migration of Ubercart 7 field formatter settings.

Namespace

Drupal\Tests\commerce_migrate_ubercart\Kernel\Migrate\uc7

Code

public function testEntityDisplaySettings() {
  $this
    ->assertNotEntity('node.product.default');
  $this
    ->assertNotEntity('commerce_product.page.default');
  $this
    ->assertNotEntity('commerce_product.article.default');
  $this
    ->assertEntity('node.article.default');
  $this
    ->assertComponent('node.article.default', 'field_image', 'image', 'hidden', -1);
  $this
    ->assertComponent('node.article.default', 'field_tags', 'entity_reference_label', 'above', 10);
  $this
    ->assertEntity('commerce_product.default.default');
  $this
    ->assertComponent('commerce_product.default.default', 'body', 'text_default', 'hidden', 0);
  $this
    ->assertComponent('commerce_product.default.default', 'variations', 'commerce_add_to_cart', 'hidden', 1);
  $this
    ->assertComponent('commerce_product.default.default', 'title', 'string', 'hidden', -5);
  $this
    ->assertEntity('commerce_product.product.default');
  $this
    ->assertComponent('commerce_product.product.default', 'body', 'text_default', 'hidden', 0);
  $this
    ->assertComponent('commerce_product.product.default', 'variations', 'commerce_add_to_cart', 'above', 10);
  $this
    ->assertComponent('commerce_product.product.default', 'field_number', 'number_integer', 'above', 3);
  $this
    ->assertComponent('commerce_product.product.default', 'field_sustainability', 'string', 'above', 4);
  $this
    ->assertComponent('commerce_product.product.default', 'taxonomy_catalog', 'entity_reference_label', 'above', 2);
  $this
    ->assertComponent('commerce_product.product.default', 'uc_product_image', 'image', 'above', 1);
  $this
    ->assertEntity('taxonomy_term.catalog.default');
  $this
    ->assertComponent('taxonomy_term.catalog.default', 'uc_catalog_image', 'image', 'above', 0);
}