You are here

protected function LayoutBuilderQuickEditTest::replaceLayoutBuilderFieldIdKeys in Drupal 9

Same name and namespace in other branches
  1. 10 core/modules/quickedit/tests/src/FunctionalJavascript/LayoutBuilderQuickEditTest.php \Drupal\Tests\quickedit\FunctionalJavascript\LayoutBuilderQuickEditTest::replaceLayoutBuilderFieldIdKeys()

Replaces the array keys with Layout Builder field IDs when needed.

Parameters

array $array: The array with field IDs as keys.

Return value

array The array with the keys replaced.

2 calls to LayoutBuilderQuickEditTest::replaceLayoutBuilderFieldIdKeys()
LayoutBuilderQuickEditTest::assertEntityInstanceFieldMarkup in core/modules/quickedit/tests/src/FunctionalJavascript/LayoutBuilderQuickEditTest.php
Asserts all in-place editable fields with markup expectations.
LayoutBuilderQuickEditTest::assertEntityInstanceFieldStates in core/modules/quickedit/tests/src/FunctionalJavascript/LayoutBuilderQuickEditTest.php
Asserts all FieldModels for the given entity instance.

File

core/modules/quickedit/tests/src/FunctionalJavascript/LayoutBuilderQuickEditTest.php, line 221

Class

LayoutBuilderQuickEditTest
Tests that Layout Builder functions with Quick Edit.

Namespace

Drupal\Tests\quickedit\FunctionalJavascript

Code

protected function replaceLayoutBuilderFieldIdKeys(array $array) {
  if (!$this->usingLayoutBuilder) {
    return $array;
  }
  $replacement = [];
  foreach ($array as $field_key => $value) {
    $new_field_key = $this
      ->getQuickEditFieldId($field_key);
    $replacement[$new_field_key] = $value;
  }
  return $replacement;
}