Issue #214760 follow-up by sun, lokapujya: Revised tests for theme name in block admin shows HTML entities: excessive check_plain().
parent
9a3772dee1
commit
fd2792c8bb
|
@ -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\'>)'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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().
|
||||
*/
|
||||
|
|
|
@ -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
|
|
@ -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
|
Loading…
Reference in New Issue