You are here

public function QuickEditLoadingTest::testDisplayOptions in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/quickedit/src/Tests/QuickEditLoadingTest.php \Drupal\quickedit\Tests\QuickEditLoadingTest::testDisplayOptions()

Tests that Quick Edit doesn't make fields rendered with display options editable.

File

core/modules/quickedit/src/Tests/QuickEditLoadingTest.php, line 403
Contains \Drupal\quickedit\Tests\QuickEditLoadingTest.

Class

QuickEditLoadingTest
Tests loading of in-place editing functionality and lazy loading of its in-place editors.

Namespace

Drupal\quickedit\Tests

Code

public function testDisplayOptions() {
  $node = Node::load('1');
  $display_settings = array(
    'label' => 'inline',
  );
  $build = $node->body
    ->view($display_settings);
  $output = \Drupal::service('renderer')
    ->renderRoot($build);
  $this
    ->assertFalse(strpos($output, 'data-quickedit-field-id'), 'data-quickedit-field-id attribute not added when rendering field using dynamic display options.');
}