Commit fd2792c8 authored by webchick's avatar webchick

Issue #214760 follow-up by sun, lokapujya: Revised tests for theme name in...

Issue #214760 follow-up by sun,  lokapujya: Revised tests for theme name in block admin shows HTML entities: excessive check_plain().
parent 9a3772de
......@@ -9,6 +9,7 @@
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 @@ public function testBlockThemeSelector() {
* 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\'>)'));
}
/**
......
......@@ -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().
*/
......
......@@ -4,13 +4,5 @@ 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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment