Chris@0: install(['bartik', 'seven']); Chris@0: $this->config('system.theme') Chris@0: ->set('default', 'bartik') Chris@0: ->set('admin', 'seven') Chris@0: ->save(); Chris@0: Chris@0: // Create and log in as a user who has permission to add and edit taxonomy Chris@0: // terms and view the administrative theme. Chris@0: $admin_user = $this->drupalCreateUser(['administer taxonomy', 'view the administration theme']); Chris@0: $this->drupalLogin($admin_user); Chris@0: } Chris@0: Chris@0: /** Chris@0: * Test the theme used when adding, viewing and editing taxonomy terms. Chris@0: */ Chris@0: public function testTaxonomyTermThemes() { Chris@0: // Adding a term to a vocabulary is considered an administrative action and Chris@0: // should use the administrative theme. Chris@0: $vocabulary = $this->createVocabulary(); Chris@0: $this->drupalGet('admin/structure/taxonomy/manage/' . $vocabulary->id() . '/add'); Chris@0: $this->assertRaw('seven/css/base/elements.css', t("The administrative theme's CSS appears on the page for adding a taxonomy term.")); Chris@0: Chris@0: // Viewing a taxonomy term should use the default theme. Chris@0: $term = $this->createTerm($vocabulary); Chris@0: $this->drupalGet('taxonomy/term/' . $term->id()); Chris@0: $this->assertRaw('bartik/css/base/elements.css', t("The default theme's CSS appears on the page for viewing a taxonomy term.")); Chris@0: Chris@0: // Editing a taxonomy term should use the same theme as adding one. Chris@0: $this->drupalGet('taxonomy/term/' . $term->id() . '/edit'); Chris@0: $this->assertRaw('seven/css/base/elements.css', t("The administrative theme's CSS appears on the page for editing a taxonomy term.")); Chris@0: } Chris@0: Chris@0: }