function MigrateFieldInstanceWidgetSettingsTest::assertEntity

Same name in other branches
  1. 9 core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceWidgetSettingsTest.php \Drupal\Tests\field\Kernel\Migrate\d7\MigrateFieldInstanceWidgetSettingsTest::assertEntity()
  2. 8.9.x core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceWidgetSettingsTest.php \Drupal\Tests\field\Kernel\Migrate\d7\MigrateFieldInstanceWidgetSettingsTest::assertEntity()
  3. 11.x 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.

@internal

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 55

Class

MigrateFieldInstanceWidgetSettingsTest
Migrate field widget settings.

Namespace

Drupal\Tests\field\Kernel\Migrate\d7

Code

protected function assertEntity(string $id, string $expected_entity_type, string $expected_bundle) : void {
    
    /** @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());
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.