function BlockAdminThemeTestCase::testAdminTheme

Check for the accessibility of the admin theme on the block admin page.

File

modules/block/block.test, line 468

Class

BlockAdminThemeTestCase
Test the block system with admin themes.

Code

function testAdminTheme() {
    // Create administrative user.
    $admin_user = $this->drupalCreateUser(array(
        'administer blocks',
        'administer themes',
    ));
    $this->drupalLogin($admin_user);
    // Ensure that access to block admin page is denied when theme is disabled.
    $this->drupalGet('admin/structure/block/list/stark');
    $this->assertResponse(403, 'The block admin page for a disabled theme can not be accessed');
    // Enable admin theme and confirm that tab is accessible.
    $edit['admin_theme'] = 'stark';
    $this->drupalPost('admin/appearance', $edit, t('Save configuration'));
    $this->drupalGet('admin/structure/block/list/stark');
    $this->assertResponse(200, 'The block admin page for the admin theme can be accessed');
}

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