function BlockHiddenRegionTestCase::testBlockNotInHiddenRegion

Tests that hidden regions do not inherit blocks when a theme is enabled.

File

modules/block/block.test, line 817

Class

BlockHiddenRegionTestCase
Tests that hidden regions do not inherit blocks when a theme is enabled.

Code

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') . ')', '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', 'Block was displayed on the front page.');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.