diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-11-20 09:31:08 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-11-20 09:31:08 +0000 |
commit | 3c9dfeb8420f3c1f4e35902878e9cc5795ce9732 (patch) | |
tree | cda05afcbef20031ef6f67851b942b8e4f7b5bc6 /modules/taxonomy/taxonomy.test | |
parent | f617f0e30a27bce03bf1ae4a527e21faa96bd2e3 (diff) | |
download | brdo-3c9dfeb8420f3c1f4e35902878e9cc5795ce9732.tar.gz brdo-3c9dfeb8420f3c1f4e35902878e9cc5795ce9732.tar.bz2 |
#678592 by jhodgdon, effulgentsia, David Rothstein, iLLin: Fixed Admin theme is used is for adding taxonomy term, but not for editing taxonomy term
Diffstat (limited to 'modules/taxonomy/taxonomy.test')
-rw-r--r-- | modules/taxonomy/taxonomy.test | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/modules/taxonomy/taxonomy.test b/modules/taxonomy/taxonomy.test index 0a08c1bde..7d5533b77 100644 --- a/modules/taxonomy/taxonomy.test +++ b/modules/taxonomy/taxonomy.test @@ -1131,3 +1131,50 @@ class TaxonomyTokenReplaceTestCase extends TaxonomyWebTestCase { } } } + +/** + * Tests for verifying that taxonomy pages use the correct theme. + */ +class TaxonomyThemeTestCase extends TaxonomyWebTestCase { + public static function getInfo() { + return array( + 'name' => 'Taxonomy theme switching', + 'description' => 'Verifies that various taxonomy pages use the expected theme.', + 'group' => 'Taxonomy', + ); + } + + function setUp() { + parent::setUp(); + + // Make sure we are using distinct default and administrative themes for + // the duration of these tests. + variable_set('theme_default', 'bartik'); + variable_set('admin_theme', 'seven'); + + // Create and log in as a user who has permission to add and edit taxonomy + // terms. + $admin_user = $this->drupalCreateUser(array('administer taxonomy')); + $this->drupalLogin($admin_user); + } + + /** + * Test the theme used when adding, viewing and editing taxonomy terms. + */ + function testTaxonomyTermThemes() { + // Adding a term to a vocabulary is considered an administrative action and + // should use the administrative theme. + $vocabulary = $this->createVocabulary(); + $this->drupalGet('admin/structure/taxonomy/' . $vocabulary->machine_name . '/add'); + $this->assertRaw('seven/style.css', t("The administrative theme's CSS appears on the page for adding a taxonomy term.")); + + // Viewing a taxonomy term should use the default theme. + $term = $this->createTerm($vocabulary); + $this->drupalGet('taxonomy/term/' . $term->tid); + $this->assertRaw('bartik/css/style.css', t("The default theme's CSS appears on the page for viewing a taxonomy term.")); + + // Editing a taxonomy term should use the same theme as adding one. + $this->drupalGet('taxonomy/term/' . $term->tid . '/edit'); + $this->assertRaw('seven/style.css', t("The administrative theme's CSS appears on the page for editing a taxonomy term.")); + } +} |