summaryrefslogtreecommitdiff
path: root/modules/system/system.test
diff options
context:
space:
mode:
Diffstat (limited to 'modules/system/system.test')
-rw-r--r--modules/system/system.test67
1 files changed, 67 insertions, 0 deletions
diff --git a/modules/system/system.test b/modules/system/system.test
index 048ecbb7c..5ce12039e 100644
--- a/modules/system/system.test
+++ b/modules/system/system.test
@@ -828,3 +828,70 @@ class SystemSettingsForm extends DrupalWebTestCase {
$this->assertTrue($no_automatic['has_children']['system_settings_form_test_5']['#default_value']);
}
}
+
+/**
+ * Tests for the theme interface functionality.
+ */
+class SystemThemeFunctionalTest extends DrupalWebTestCase {
+ function getInfo() {
+ return array(
+ 'name' => t('Theme interface functionality'),
+ 'description' => t('Tests the theme interface functionality by enabling and switching themes, and using an administration theme.'),
+ 'group' => t('System'),
+ );
+ }
+
+ function setUp() {
+ parent::setUp();
+
+ $this->admin_user = $this->drupalCreateUser(array('access administration pages', 'administer site configuration', 'bypass node access'));
+ $this->drupalLogin($this->admin_user);
+ $this->node = $this->drupalCreateNode();
+ }
+
+ /**
+ * Test the administration theme functionality.
+ */
+ function testAdministrationTheme() {
+ // Enable an administration theme and show it on the node admin pages.
+ $edit = array(
+ 'theme_default' => 'stark',
+ 'admin_theme' => 'garland',
+ 'node_admin_theme' => TRUE,
+ );
+ $this->drupalPost('admin/build/themes', $edit, t('Save configuration'));
+
+ $this->drupalGet('admin');
+ $this->assertRaw('themes/garland', t('Administration theme used on an administration page.'));
+
+ $this->drupalGet('node/' . $this->node->nid);
+ $this->assertRaw('themes/stark', t('Site default theme used on node page.'));
+
+ $this->drupalGet('node/add');
+ $this->assertRaw('themes/garland', t('Administration theme used on the add content page.'));
+
+ $this->drupalGet('node/' . $this->node->nid . '/edit');
+ $this->assertRaw('themes/garland', t('Administration theme used on the edit content page.'));
+
+ // Disable the admin theme on the node admin pages.
+ $edit = array(
+ 'node_admin_theme' => FALSE,
+ );
+ $this->drupalPost('admin/build/themes', $edit, t('Save configuration'));
+
+ $this->drupalGet('admin');
+ $this->assertRaw('themes/garland', t('Administration theme used on an administration page.'));
+
+ $this->drupalGet('node/add');
+ $this->assertRaw('themes/stark', t('Site default theme used on the add content page.'));
+
+ // Reset to the default theme settings.
+ $this->drupalPost('admin/build/themes', array(), t('Reset to defaults'));
+
+ $this->drupalGet('admin');
+ $this->assertRaw('themes/garland', t('Site default theme used on administration page.'));
+
+ $this->drupalGet('node/add');
+ $this->assertRaw('themes/garland', t('Site default theme used on the add content page.'));
+ }
+}