summaryrefslogtreecommitdiff
path: root/modules/block/block.test
diff options
context:
space:
mode:
Diffstat (limited to 'modules/block/block.test')
-rw-r--r--modules/block/block.test32
1 files changed, 32 insertions, 0 deletions
diff --git a/modules/block/block.test b/modules/block/block.test
index 34618e92d..9cef03036 100644
--- a/modules/block/block.test
+++ b/modules/block/block.test
@@ -191,3 +191,35 @@ class NonDefaultBlockAdmin extends DrupalWebTestCase {
$this->assertRaw('stark/layout.css', t('Stark CSS found'));
}
}
+
+/**
+ * Test the block system with admin themes.
+ */
+class BlockAdminThemeTestCase extends DrupalWebTestCase {
+ public static function getInfo() {
+ return array(
+ 'name' => t('Admin theme block admin accessibility'),
+ 'description' => t("Check whether the block administer page for a disabled theme acccessible if and only if it's the admin theme."),
+ 'group' => t('Block'),
+ );
+ }
+
+ /**
+ * Check for the accessibility of the admin theme on the block admin page.
+ */
+ function testAdminTheme() {
+ // Create administrative user.
+ $admin_user = $this->drupalCreateUser(array('administer blocks', 'administer site configuration'));
+ $this->drupalLogin($admin_user);
+
+ // Ensure that access to block admin page is denied when theme is disabled.
+ $this->drupalGet('admin/build/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/build/themes', $edit, t('Save configuration'));
+ $this->drupalGet('admin/build/block/list/stark');
+ $this->assertResponse(200, t('The block admin page for the admin theme can be accessed'));
+ }
+}