You are here

protected function FieldWidgetSettingsTest::assertEntity in Commerce Migrate 3.0.x

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

Asserts various aspects of a form display entity.

Parameters

string $id: The entity ID.

string $expected_entity_type: The expected entity type to which the display settings are attached.

string $expected_bundle: The expected bundle to which the display settings are attached.

1 call to FieldWidgetSettingsTest::assertEntity()
FieldWidgetSettingsTest::testWidgetSettings in modules/ubercart/tests/src/Kernel/Migrate/uc7/FieldWidgetSettingsTest.php
Test that commerce_product settings are created.

File

modules/ubercart/tests/src/Kernel/Migrate/uc7/FieldWidgetSettingsTest.php, line 57

Class

FieldWidgetSettingsTest
Tests migration of Ubercart 7 field widget settings.

Namespace

Drupal\Tests\commerce_migrate_ubercart\Kernel\Migrate\uc7

Code

protected function assertEntity($id, $expected_entity_type, $expected_bundle) {

  /** @var \Drupal\Core\Entity\Display\EntityFormDisplayInterface $entity */
  $entity = EntityFormDisplay::load($id);
  $this
    ->assertInstanceOf(EntityFormDisplayInterface::class, $entity);
  $this
    ->assertSame($expected_entity_type, $entity
    ->getTargetEntityTypeId());
  $this
    ->assertSame($expected_bundle, $entity
    ->getTargetBundle());
}