Commit e0e146f1 authored by webchick's avatar webchick

Issue #1016582 by mfb, sun: Fixed Help block empty on every page, or the same...

Issue #1016582 by mfb, sun: Fixed Help block empty on every page, or the same on every page, due to 'cache per role'.
parent aefad860
......@@ -2018,6 +2018,7 @@ function system_block_info() {
$blocks['help'] = array(
'info' => t('System help'),
'weight' => '5',
'cache' => DRUPAL_NO_CACHE,
);
// System-defined menu blocks.
foreach (menu_list_system_menus() as $menu_name => $title) {
......
......@@ -1362,6 +1362,8 @@ class FrontPageTestCase extends DrupalWebTestCase {
}
class SystemBlockTestCase extends DrupalWebTestCase {
protected $profile = 'testing';
public static function getInfo() {
return array(
'name' => 'Block functionality',
......@@ -1371,17 +1373,17 @@ class SystemBlockTestCase extends DrupalWebTestCase {
}
function setUp() {
parent::setUp();
parent::setUp('block');
// Create and login user
$admin_user = $this->drupalCreateUser(array('administer blocks'));
$admin_user = $this->drupalCreateUser(array('administer blocks', 'access administration pages'));
$this->drupalLogin($admin_user);
}
/**
* Test displaying and hiding the powered-by block.
* Test displaying and hiding the powered-by and help blocks.
*/
function testPoweredByBlock() {
function testSystemBlocks() {
// Set block title and some settings to confirm that the interface is available.
$this->drupalPost('admin/structure/block/manage/system/powered-by/configure', array('title' => $this->randomName(8)), t('Save block'));
$this->assertText(t('The block configuration has been saved.'), t('Block configuration set.'));
......@@ -1389,6 +1391,7 @@ class SystemBlockTestCase extends DrupalWebTestCase {
// Set the powered-by block to the footer region.
$edit = array();
$edit['blocks[system_powered-by][region]'] = 'footer';
$edit['blocks[system_main][region]'] = 'content';
$this->drupalPost('admin/structure/block', $edit, t('Save blocks'));
$this->assertText(t('The block settings have been updated.'), t('Block successfully moved to footer region.'));
......@@ -1409,6 +1412,18 @@ class SystemBlockTestCase extends DrupalWebTestCase {
$edit['blocks[system_powered-by][region]'] = 'footer';
$this->drupalPost('admin/structure/block', $edit, t('Save blocks'));
$this->drupalPost('admin/structure/block/manage/system/powered-by/configure', array('title' => ''), t('Save block'));
// Set the help block to the help region.
$edit = array();
$edit['blocks[system_help][region]'] = 'help';
$this->drupalPost('admin/structure/block', $edit, t('Save blocks'));
// Test displaying the help block with block caching enabled.
variable_set('block_cache', TRUE);
$this->drupalGet('admin/structure/block/add');
$this->assertRaw(t('Use this page to create a new custom block.'));
$this->drupalGet('admin/index');
$this->assertRaw(t('This page shows you all available administration tasks for each module.'));
}
}
......
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