You are here

protected function FieldFormatterSettingsTest::assertComponent in Commerce Migrate 8.2

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

Asserts various aspects of a particular component of a view display.

Parameters

string $display_id: The view display ID.

string $component_id: The component ID.

string $type: The expected component type (formatter plugin ID).

string $label: The expected label of the component.

int $weight: The expected weight of the component.

1 call to FieldFormatterSettingsTest::assertComponent()
FieldFormatterSettingsTest::testMigration in modules/commerce/tests/src/Kernel/Migrate/commerce1/FieldFormatterSettingsTest.php
Tests migration of D7 field formatter settings.

File

modules/commerce/tests/src/Kernel/Migrate/commerce1/FieldFormatterSettingsTest.php, line 83

Class

FieldFormatterSettingsTest
Tests field formatter settings migration.

Namespace

Drupal\Tests\commerce_migrate_commerce\Kernel\Migrate\commerce1

Code

protected function assertComponent($display_id, $component_id, $type, $label, $weight) {
  $component = EntityViewDisplay::load($display_id)
    ->getComponent($component_id);
  $this
    ->assertTrue(is_array($component));
  $this
    ->assertSame($type, $component['type']);
  $this
    ->assertSame($label, $component['label']);
  $this
    ->assertSame($weight, $component['weight']);
}