You are here

protected function QuickEditIntegrationTest::getSelectedEditor in Zircon Profile 8

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

Returns the in-place editor that Edit selects.

1 call to QuickEditIntegrationTest::getSelectedEditor()
QuickEditIntegrationTest::testEditorSelection in core/modules/editor/src/Tests/QuickEditIntegrationTest.php
Tests editor selection when the Editor module is present.

File

core/modules/editor/src/Tests/QuickEditIntegrationTest.php, line 116
Contains \Drupal\editor\Tests\QuickEditIntegrationTest.

Class

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

Namespace

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