protected function EditorSelectionTest::getSelectedEditor

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

3 calls to EditorSelectionTest::getSelectedEditor()
EditorSelectionTest::testNumber in drupal/core/modules/edit/lib/Drupal/edit/Tests/EditorSelectionTest.php
Tests a number field, with cardinality 1 and >1.
EditorSelectionTest::testText in drupal/core/modules/edit/lib/Drupal/edit/Tests/EditorSelectionTest.php
Tests a textual field, without/with text processing, with cardinality 1 and >1, always without a WYSIWYG editor present.
EditorSelectionTest::testTextWysiwyg in drupal/core/modules/edit/lib/Drupal/edit/Tests/EditorSelectionTest.php
Tests a textual field, with text processing, with cardinality 1 and >1, always with an Editor plugin present that supports textual fields with text processing, but with varying text format compatibility.

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);
}