You are here

protected function MigrateFieldInstanceWidgetSettingsTest::assertEntity in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceWidgetSettingsTest.php \Drupal\Tests\field\Kernel\Migrate\d7\MigrateFieldInstanceWidgetSettingsTest::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 MigrateFieldInstanceWidgetSettingsTest::assertEntity()
MigrateFieldInstanceWidgetSettingsTest::testWidgetSettings in core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceWidgetSettingsTest.php
Tests that migrated view modes can be loaded using D8 APIs.

File

core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceWidgetSettingsTest.php, line 52

Class

MigrateFieldInstanceWidgetSettingsTest
Migrate field widget settings.

Namespace

Drupal\Tests\field\Kernel\Migrate\d7

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());
}