You are here

public function QuickEditLoadingTest::testContentBlock in Zircon Profile 8

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

Tests that Quick Edit's data- attributes are present for content blocks.

File

core/modules/quickedit/src/Tests/QuickEditLoadingTest.php, line 508
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 testContentBlock() {
  \Drupal::service('module_installer')
    ->install(array(
    'block_content',
  ));

  // Create and place a content_block block.
  $block = BlockContent::create([
    'info' => $this
      ->randomMachineName(),
    'type' => 'basic',
    'langcode' => 'en',
  ]);
  $block
    ->save();
  $this
    ->drupalPlaceBlock('block_content:' . $block
    ->uuid());

  // Check that the data- attribute is present.
  $this
    ->drupalGet('');
  $this
    ->assertRaw('data-quickedit-entity-id="block_content/1"');
}