You are here

public function LayoutSectionTest::testLayoutSectionFormatter in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/layout_builder/tests/src/Functional/LayoutSectionTest.php \Drupal\Tests\layout_builder\Functional\LayoutSectionTest::testLayoutSectionFormatter()

Tests layout_section formatter output.

@dataProvider providerTestLayoutSectionFormatter

File

core/modules/layout_builder/tests/src/Functional/LayoutSectionTest.php, line 172

Class

LayoutSectionTest
Tests the rendering of a layout section field.

Namespace

Drupal\Tests\layout_builder\Functional

Code

public function testLayoutSectionFormatter($layout_data, $expected_selector, $expected_content, $expected_cache_contexts, $expected_cache_tags, $expected_dynamic_cache) {
  $node = $this
    ->createSectionNode($layout_data);
  $canonical_url = $node
    ->toUrl('canonical');
  $this
    ->drupalGet($canonical_url);
  $this
    ->assertLayoutSection($expected_selector, $expected_content, $expected_cache_contexts, $expected_cache_tags, $expected_dynamic_cache);
  $this
    ->drupalGet($canonical_url
    ->toString() . '/layout');
  $this
    ->assertLayoutSection($expected_selector, $expected_content, $expected_cache_contexts, $expected_cache_tags, 'UNCACHEABLE');
}