You are here

protected function ComplexWidgetTest::updateSetting in Inline Entity Form 8

Updates an IEF setting and saves the underlying entity display.

Parameters

string $name: The name of the setting.

mixed $value: The value to set.

8 calls to ComplexWidgetTest::updateSetting()
ComplexWidgetTest::testDuplicatingEntities in tests/src/FunctionalJavascript/ComplexWidgetTest.php
Tests if duplicating entities works.
ComplexWidgetTest::testEditedInlineEntityValidation in tests/src/FunctionalJavascript/ComplexWidgetTest.php
Tests if a referenced content can be edited.
ComplexWidgetTest::testEmptyField in tests/src/FunctionalJavascript/ComplexWidgetTest.php
Tests if form behaves correctly when field is empty.
ComplexWidgetTest::testEntityCreation in tests/src/FunctionalJavascript/ComplexWidgetTest.php
Tests creation of entities.
ComplexWidgetTest::testEntityEditingAndRemoving in tests/src/FunctionalJavascript/ComplexWidgetTest.php
Tests if editing and removing entities work.

... See full list

File

tests/src/FunctionalJavascript/ComplexWidgetTest.php, line 742

Class

ComplexWidgetTest
IEF complex field widget tests.

Namespace

Drupal\Tests\inline_entity_form\FunctionalJavascript

Code

protected function updateSetting(string $name, $value) {

  /** @var \Drupal\Core\Entity\Display\EntityFormDisplayInterface $display */
  $display = $this->entityFormDisplayStorage
    ->load('node.ief_test_complex.default');
  $component = $display
    ->getComponent('multi');
  $component['settings'][$name] = $value;
  $display
    ->setComponent('multi', $component)
    ->save();
}