summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/system/system.module1
-rw-r--r--modules/system/system.test23
2 files changed, 20 insertions, 4 deletions
diff --git a/modules/system/system.module b/modules/system/system.module
index 5af9ad4ee..c3b4a1e39 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -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) {
diff --git a/modules/system/system.test b/modules/system/system.test
index fee187f5b..0fe0bc057 100644
--- a/modules/system/system.test
+++ b/modules/system/system.test
@@ -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.'));
}
}