You are here

public function HtmlTitleTest::testRevisionsPage in HTML Title 8

Tests the revision pages in combination with HTML Title.

File

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

Class

HtmlTitleTest
Tests the HTML Title module.

Namespace

Drupal\Tests\html_title\Functional

Code

public function testRevisionsPage() {
  $assert_session = $this
    ->assertSession();
  $node_1_revision = clone $this->node1;
  $node_1_revision
    ->set('body', [
    'value' => $this->randomGenerator
      ->paragraphs(12),
  ]);
  $node_1_revision
    ->setNewRevision();
  $node_1_revision
    ->save();
  $this
    ->drupalGet(Url::fromRoute('node.revision_revert_confirm', [
    'node' => $this->node1
      ->id(),
    'node_revision' => $this->node1
      ->getRevisionId(),
  ]));
  $assert_session
    ->responseContains('<h1>Test <sup>sup</sup>-tag</h1>');
  $this
    ->drupalGet(Url::fromRoute('entity.node.revision', [
    'node' => $this->node1
      ->id(),
    'node_revision' => $this->node1
      ->getRevisionId(),
  ]));
  $assert_session
    ->responseContains('<h1>Test <sup>sup</sup>-tag</h1>');
  $this
    ->drupalGet(Url::fromRoute('node.revision_delete_confirm', [
    'node' => $this->node1
      ->id(),
    'node_revision' => $this->node1
      ->getRevisionId(),
  ]));
  $assert_session
    ->responseContains('<h1>Test <sup>sup</sup>-tag</h1>');
}