protected function EditorSelectionTest::getSelectedEditor

Retrieves the FieldInstance object for the given field and returns the editor that Edit selects.

3 calls to EditorSelectionTest::getSelectedEditor()

File

drupal/core/modules/edit/lib/Drupal/edit/Tests/EditorSelectionTest.php, line 51
Contains \Drupal\edit\Tests\EditorSelectionTest.

Class

EditorSelectionTest
Test in-place field editor selection.

Namespace

Drupal\edit\Tests

Code

protected function getSelectedEditor($items, $field_name, $view_mode = 'default') {
  $options = entity_get_display('entity_test', 'entity_test', $view_mode)
    ->getComponent($field_name);
  $field_instance = field_info_instance('entity_test', $field_name, 'entity_test');
  return $this->editorSelector
    ->getEditor($options['type'], $field_instance, $items);
}