diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockTest.php index 1a0fd00206f..bc80fd8ddbb 100644 --- a/core/modules/block/lib/Drupal/block/Tests/BlockTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/BlockTest.php @@ -9,6 +9,7 @@ namespace Drupal\block\Tests; use Drupal\Core\Cache\Cache; use Drupal\simpletest\WebTestBase; +use Drupal\Component\Utility\String; /** * Provides testing for basic block module functionality. @@ -185,20 +186,16 @@ class BlockTest extends BlockTestBase { * Test block display of theme titles. */ function testThemeName() { - \Drupal::moduleHandler()->install(array('block_test')); + // Enable the help block. + $this->drupalPlaceBlock('system_help_block', array('region' => 'help')); // Explicitly set the default and admin themes. - $theme = 'cat_mouse'; - theme_enable(array($theme, 'seven', 'block_test_theme')); - $this->resetAll(); - - \Drupal::config('system.theme') - ->set('default', 'seven') - ->set('admin', 'seven') - ->save(); + $theme = 'block_test_specialchars_theme'; + theme_enable(array($theme)); \Drupal::service('router.builder')->rebuild(); - $this->drupalGet('admin/appearance'); $this->drupalGet('admin/structure/block'); - $this->assertText('<"Cat" & 'Mouse'>'); + $this->assertRaw(String::checkPlain('<"Cat" & \'Mouse\'>')); + $this->drupalGet('admin/structure/block/list/block_test_specialchars_theme'); + $this->assertRaw(String::checkPlain('Demonstrate block regions (<"Cat" & \'Mouse\'>)')); } /** diff --git a/core/modules/block/tests/modules/block_test/block_test.module b/core/modules/block/tests/modules/block_test/block_test.module index 726043c17bf..a527ae1ddee 100644 --- a/core/modules/block/tests/modules/block_test/block_test.module +++ b/core/modules/block/tests/modules/block_test/block_test.module @@ -7,15 +7,6 @@ use Drupal\block\BlockPluginInterface; -/** - * Implements hook_system_theme_info(). - */ -function block_test_system_theme_info() { - $themes['block_test_theme'] = drupal_get_path('module', 'block_test') . '/themes/block_test_theme/block_test_theme.info.yml'; - $themes['cat_mouse'] = drupal_get_path('module', 'block_test') . '/themes/cat_mouse/cat_mouse.info.yml'; - return $themes; -} - /** * Implements hook_block_alter(). */ diff --git a/core/modules/block/tests/modules/block_test/themes/block_test_specialchars_theme/block_test_specialchars_theme.info.yml b/core/modules/block/tests/modules/block_test/themes/block_test_specialchars_theme/block_test_specialchars_theme.info.yml new file mode 100644 index 00000000000..5b4689eddbc --- /dev/null +++ b/core/modules/block/tests/modules/block_test/themes/block_test_specialchars_theme/block_test_specialchars_theme.info.yml @@ -0,0 +1,8 @@ +name: '<"Cat" & ''Mouse''>' +type: theme +description: 'Theme for testing special characters in block admin.' +core: 8.x +hidden: true +regions: + content: Content + help: Help diff --git a/core/modules/block/tests/modules/block_test/themes/cat_mouse/cat_mouse.info.yml b/core/modules/block/tests/modules/block_test/themes/cat_mouse/cat_mouse.info.yml deleted file mode 100644 index 999f7f3b3ca..00000000000 --- a/core/modules/block/tests/modules/block_test/themes/cat_mouse/cat_mouse.info.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: '<"Cat" & ''Mouse''>' -type: theme -description: 'Theme for testing special characters in block admin.' -core: 8.x -hidden: true -regions: - sidebar_first: 'Left sidebar' - sidebar_second: 'Right sidebar' - content: Content - header: Header - footer: Footer - highlighted: Highlighted - help: Help -regions_hidden: - - sidebar_first - - sidebar_second