function MigrateFieldInstanceWidgetSettingsTest::assertComponent

Same name in other branches
  1. 8.9.x core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceWidgetSettingsTest.php \Drupal\Tests\field\Kernel\Migrate\d7\MigrateFieldInstanceWidgetSettingsTest::assertComponent()
  2. 10 core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceWidgetSettingsTest.php \Drupal\Tests\field\Kernel\Migrate\d7\MigrateFieldInstanceWidgetSettingsTest::assertComponent()
  3. 11.x core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceWidgetSettingsTest.php \Drupal\Tests\field\Kernel\Migrate\d7\MigrateFieldInstanceWidgetSettingsTest::assertComponent()

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

@internal

Parameters

string $display_id: The form display ID.

string $component_id: The component ID.

string $widget_type: The expected widget type.

int $weight: The expected weight of the component.

1 call to MigrateFieldInstanceWidgetSettingsTest::assertComponent()
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 77

Class

MigrateFieldInstanceWidgetSettingsTest
Migrate field widget settings.

Namespace

Drupal\Tests\field\Kernel\Migrate\d7

Code

protected function assertComponent(string $display_id, string $component_id, string $widget_type, int $weight) : void {
    $component = EntityFormDisplay::load($display_id)->getComponent($component_id);
    $this->assertIsArray($component);
    $this->assertSame($widget_type, $component['type']);
    $this->assertSame($weight, $component['weight']);
}

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