You are here

function BlockTest::testThemeName in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/block/src/Tests/BlockTest.php \Drupal\block\Tests\BlockTest::testThemeName()

Test block display of theme titles.

File

core/modules/block/src/Tests/BlockTest.php, line 225
Contains \Drupal\block\Tests\BlockTest.

Class

BlockTest
Tests basic block functionality.

Namespace

Drupal\block\Tests

Code

function testThemeName() {

  // Enable the help block.
  $this
    ->drupalPlaceBlock('help_block', array(
    'region' => 'help',
  ));
  $this
    ->drupalPlaceBlock('local_tasks_block');

  // Explicitly set the default and admin themes.
  $theme = 'block_test_specialchars_theme';
  \Drupal::service('theme_handler')
    ->install(array(
    $theme,
  ));
  \Drupal::service('router.builder')
    ->rebuild();
  $this
    ->drupalGet('admin/structure/block');
  $this
    ->assertEscaped('<"Cat" & \'Mouse\'>');
  $this
    ->drupalGet('admin/structure/block/list/block_test_specialchars_theme');
  $this
    ->assertEscaped('Demonstrate block regions (<"Cat" & \'Mouse\'>)');
}