HtmlTitleLayoutBuilderTest.php in HTML Title 8
File
tests/src/Functional/HtmlTitleLayoutBuilderTest.php
View source
<?php
namespace Drupal\Tests\html_title\Functional;
use Drupal\Tests\BrowserTestBase;
class HtmlTitleLayoutBuilderTest extends BrowserTestBase {
protected static $modules = [
'html_title',
'node',
'layout_builder',
];
protected $defaultTheme = 'stark';
protected $node;
protected function setUp() : void {
parent::setUp();
$this
->drupalLogin($this->rootUser);
$this
->drupalCreateContentType([
'type' => 'test',
]);
$this->node = $this
->drupalCreateNode([
'title' => 'Test <sup>sup</sup>-tag',
'type' => 'test',
]);
}
public function testLayoutBuilder() {
$this
->drupalGet('admin/structure/types/manage/test/display');
$this
->submitForm([
'layout[enabled]' => TRUE,
], 'Save');
$this
->clickLink('Manage layout');
$this
->clickLink('Add block');
$this
->clickLink('Title');
$this
->submitForm([], 'Add block');
$this
->submitForm([], 'Save layout');
$this
->drupalGet('node/' . $this->node
->id());
$this
->assertSession()
->responseContains('Test <sup>sup</sup>-tag');
}
}