You are here

protected function EditorSelectionTest::getSelectedEditor in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/quickedit/src/Tests/EditorSelectionTest.php \Drupal\quickedit\Tests\EditorSelectionTest::getSelectedEditor()

Returns the in-place editor that Quick Edit selects.

3 calls to EditorSelectionTest::getSelectedEditor()
EditorSelectionTest::testNumber in core/modules/quickedit/src/Tests/EditorSelectionTest.php
Tests a number field, with cardinality 1 and >1.
EditorSelectionTest::testText in core/modules/quickedit/src/Tests/EditorSelectionTest.php
Tests a string (plain text) field, with cardinality 1 and >1.
EditorSelectionTest::testTextWysiwyg in core/modules/quickedit/src/Tests/EditorSelectionTest.php
Tests a textual field, with text filtering, with cardinality 1 and >1, always with an Editor plugin present that supports textual fields with text filtering, but with varying text format compatibility.

File

core/modules/quickedit/src/Tests/EditorSelectionTest.php, line 43
Contains \Drupal\quickedit\Tests\EditorSelectionTest.

Class

EditorSelectionTest
Tests in-place field editor selection.

Namespace

Drupal\quickedit\Tests

Code

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