summaryrefslogtreecommitdiff
path: root/modules/system/system.test
diff options
context:
space:
mode:
Diffstat (limited to 'modules/system/system.test')
-rw-r--r--modules/system/system.test23
1 files changed, 19 insertions, 4 deletions
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.'));
}
}