1 taxonomy.test | TaxonomyThemeTestCase::testTaxonomyTermThemes() |
Test the theme used when adding, viewing and editing taxonomy terms.
File
- core/
modules/ taxonomy/ tests/ taxonomy.test, line 2008 - Tests for taxonomy.module.
Class
- TaxonomyThemeTestCase
- Tests for verifying that taxonomy pages use the correct theme.
Code
function testTaxonomyTermThemes() {
// Adding a term to a vocabulary is considered an administrative action and
// should use the administrative theme.
$vocabulary = $this->createVocabulary();
$this->backdropGet('admin/structure/taxonomy/' . $vocabulary->machine_name . '/add');
$this->assertRaw('seven/css/style.css', "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->backdropGet('taxonomy/term/' . $term->tid);
$this->assertRaw('bartik/css/style.css', "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->backdropGet('taxonomy/term/' . $term->tid . '/edit');
$this->assertRaw('seven/css/style.css', "The administrative theme's CSS appears on the page for editing a taxonomy term.");
}