summaryrefslogtreecommitdiff
path: root/modules/block
diff options
context:
space:
mode:
authorwebchick <webchick@24967.no-reply.drupal.org>2011-11-03 21:12:28 -0700
committerwebchick <webchick@24967.no-reply.drupal.org>2011-11-03 21:12:28 -0700
commit70ebc5e784cd6daf72a3ceeebc71b5a0032badec (patch)
tree78fa7c167c8e5c0e3d716a77bb805dad9703f6f6 /modules/block
parentec0f197e3c199438b77670e3e679f3dde88ada15 (diff)
downloadbrdo-70ebc5e784cd6daf72a3ceeebc71b5a0032badec.tar.gz
brdo-70ebc5e784cd6daf72a3ceeebc71b5a0032badec.tar.bz2
Issue #1103590 follow-up by Tor Arne Thune, dcrocks: Add tests for blocks being added to 'hidden' region.
Diffstat (limited to 'modules/block')
-rw-r--r--modules/block/block.test36
1 files changed, 36 insertions, 0 deletions
diff --git a/modules/block/block.test b/modules/block/block.test
index 216668719..9639b2c10 100644
--- a/modules/block/block.test
+++ b/modules/block/block.test
@@ -751,3 +751,39 @@ class BlockTemplateSuggestionsUnitTest extends DrupalUnitTestCase {
$this->assertEqual($variables2['theme_hook_suggestions'], array('block__footer', 'block__block', 'block__block__hyphen_test'), t('Hyphens (-) in block delta were replaced by underscore (_)'));
}
}
+
+/**
+ * Tests that hidden regions do not inherit blocks when a theme is enabled.
+ */
+class BlockHiddenRegionTestCase extends DrupalWebTestCase {
+ public static function getInfo() {
+ return array(
+ 'name' => 'Blocks not in hidden region',
+ 'description' => 'Checks that a newly enabled theme does not inherit blocks to its hidden regions.',
+ 'group' => 'Block',
+ );
+ }
+
+ /**
+ * Tests that hidden regions do not inherit blocks when a theme is enabled.
+ */
+ function testBlockNotInHiddenRegion() {
+ // Create administrative user.
+ $admin_user = $this->drupalCreateUser(array('administer blocks', 'administer themes', 'search content'));
+ $this->drupalLogin($admin_user);
+
+ // Enable "block_test_theme" and set it as the default theme.
+ $theme = 'block_test_theme';
+ theme_enable(array($theme));
+ variable_set('theme_default', $theme);
+ menu_rebuild();
+
+ // Ensure that "block_test_theme" is set as the default theme.
+ $this->drupalGet('admin/structure/block');
+ $this->assertText('Block test theme(' . t('active tab') . ')', t('Default local task on blocks admin page is the block test theme.'));
+
+ // Ensure that the search form block is displayed.
+ $this->drupalGet('');
+ $this->assertText('Search form', t('Block was displayed on the front page.'));
+ }
+}