protected function EditIntegrationTest::getSelectedEditor

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

1 call to EditIntegrationTest::getSelectedEditor()
EditIntegrationTest::testEditorSelection in drupal/core/modules/editor/lib/Drupal/editor/Tests/EditIntegrationTest.php
Tests editor selection when the Editor module is present.

File

drupal/core/modules/editor/lib/Drupal/editor/Tests/EditIntegrationTest.php, line 112
Contains \Drupal\editor\Tests\EditorIntegrationTest.

Class

EditIntegrationTest
Tests Edit module integration (Editor module's inline editing support).

Namespace

Drupal\editor\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);
}