protected function BlockHtmlTest::setUp in Drupal 10
Same name and namespace in other branches
- 8 core/modules/block/tests/src/Functional/BlockHtmlTest.php \Drupal\Tests\block\Functional\BlockHtmlTest::setUp()
- 9 core/modules/block/tests/src/Functional/BlockHtmlTest.php \Drupal\Tests\block\Functional\BlockHtmlTest::setUp()
File
- core/
modules/ block/ tests/ src/ Functional/ BlockHtmlTest.php, line 26
Class
- BlockHtmlTest
- Tests block HTML ID validity.
Namespace
Drupal\Tests\block\FunctionalCode
protected function setUp() : void {
parent::setUp();
$this
->drupalLogin($this->rootUser);
// Enable the test_html block, to test HTML ID and attributes.
\Drupal::state()
->set('block_test.attributes', [
'data-custom-attribute' => 'foo',
]);
\Drupal::state()
->set('block_test.content', $this
->randomMachineName());
$this
->drupalPlaceBlock('test_html', [
'id' => 'test_html_block',
]);
// Enable a menu block, to test more complicated HTML.
$this
->drupalPlaceBlock('system_menu_block:admin', [
'id' => 'test_menu_block',
]);
}