You are here

public function LayoutSectionTest::testLayoutPageTitle in Drupal 9

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

Ensures that the entity title is displayed.

File

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

Class

LayoutSectionTest
Tests the rendering of a layout section field.

Namespace

Drupal\Tests\layout_builder\Functional

Code

public function testLayoutPageTitle() {
  $this
    ->drupalPlaceBlock('page_title_block');
  $node = $this
    ->createSectionNode([]);
  $this
    ->drupalGet($node
    ->toUrl('canonical')
    ->toString() . '/layout');
  $this
    ->assertSession()
    ->titleEquals('Edit layout for The node title | Drupal');
  $this
    ->assertEquals('Edit layout for The node title', $this
    ->cssSelect('h1.page-title')[0]
    ->getText());
}