assertLayoutSection example

/** * Tests layout_section formatter output. * * @dataProvider providerTestLayoutSectionFormatter */
  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');
  }

  /** * Tests the access checking of the section formatter. */
  public function testLayoutSectionFormatterAccess() {
    $node = $this->createSectionNode([
      [
        
Home | Imprint | This part of the site doesn't use cookies.