function BlockTest::testThemeName
Same name in other branches
- 8.9.x core/modules/block/tests/src/Functional/BlockTest.php \Drupal\Tests\block\Functional\BlockTest::testThemeName()
- 10 core/modules/block/tests/src/Functional/BlockTest.php \Drupal\Tests\block\Functional\BlockTest::testThemeName()
- 11.x core/modules/block/tests/src/Functional/BlockTest.php \Drupal\Tests\block\Functional\BlockTest::testThemeName()
Tests block display of theme titles.
File
-
core/
modules/ block/ tests/ src/ Functional/ BlockTest.php, line 303
Class
- BlockTest
- Tests basic block functionality.
Namespace
Drupal\Tests\block\FunctionalCode
public function testThemeName() {
// Enable the help block.
$this->drupalPlaceBlock('help_block', [
'region' => 'help',
]);
$this->drupalPlaceBlock('local_tasks_block');
// Explicitly set the default and admin themes.
$theme = 'block_test_specialchars_theme';
\Drupal::service('theme_installer')->install([
$theme,
]);
$this->drupalGet('admin/structure/block');
$this->assertSession()
->assertEscaped('<"Cat" & \'Mouse\'>');
$this->drupalGet('admin/structure/block/list/block_test_specialchars_theme');
$this->assertSession()
->assertEscaped('Demonstrate block regions (<"Cat" & \'Mouse\'>)');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.