BlockAdminThemeTestCase::testAdminTheme

7 block.test BlockAdminThemeTestCase::testAdminTheme()
8 block.test BlockAdminThemeTestCase::testAdminTheme()

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

File

modules/block/block.test, line 468
Tests for block.module.

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, t('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, t('The block admin page for the admin theme can be accessed'));
}
Login or register to post comments