You are here

public function HtmlTitleTest::testPageTitleBlock in HTML Title 8

Tests the page title block in combination with HTML Title.

File

tests/src/Functional/HtmlTitleTest.php, line 138

Class

HtmlTitleTest
Tests the HTML Title module.

Namespace

Drupal\Tests\html_title\Functional

Code

public function testPageTitleBlock() {
  $assert_session = $this
    ->assertSession();
  $this
    ->drupalGet($this->node1
    ->toUrl());
  $assert_session
    ->responseContains('<h1>Test <sup>sup</sup>-tag</h1>');
  $this
    ->drupalGet($this->node2
    ->toUrl());
  $assert_session
    ->responseContains('<h1>Test <sup>sup</sup>-tag, <sub>sub</sub>-tag and <br>br-tag</h1>');
  $this
    ->drupalGet($this->node3
    ->toUrl());
  $assert_session
    ->responseContains('<h1>Test <sup>sup</sup>-tag, <sub>sub</sub>-tag, <br>br-tag and p-tag</h1>');

  // Check that translations still work.
  $this
    ->drupalGet('fr/node/' . $this->node3
    ->id());
  $assert_session
    ->responseContains('<h1>Test <sup>sup</sup>-tag, <sub>sub</sub>-tag, <br>br-tag and p-tag FR</h1>');
  $this
    ->drupalGet($this->node4
    ->toUrl());
  $assert_session
    ->responseContains('<h1>Test p-tag</h1>');
}