You are here

public function KeyValueTextfieldWidgetTest::testWidgetSettings in Key value field 8

Testing key_value_textfield widget setting.

File

tests/src/Kernel/KeyValueTextfieldWidgetTest.php, line 16

Class

KeyValueTextfieldWidgetTest
@coversDefaultClass \Drupal\key_value_field\Plugin\Field\FieldWidget\KeyValueTextfieldWidget @group key_value_field

Namespace

Drupal\Tests\key_value_field\Kernel

Code

public function testWidgetSettings() {
  $this
    ->createTestField('key_value');
  $entity_form_display = EntityFormDisplay::create([
    'targetEntityType' => 'entity_test',
    'bundle' => 'entity_test',
    'mode' => 'default',
  ]);
  $entity_form_display
    ->setComponent('test_key_value_field', [
    'type' => 'key_value_textfield',
  ]);
  $entity_form_display
    ->save();
}