public function ThemekeyUITestCase::testAuthorTriggersTheme in ThemeKey 7.3
File
- tests/
ThemekeyUITestCase.test, line 56 - Implements tests for the theme switching rules.
Class
- ThemekeyUITestCase
- @file Implements tests for the theme switching rules.
Code
public function testAuthorTriggersTheme() {
$this
->drupalLogin($this->content_user);
$this
->enableContactForm();
$this
->drupalLogout();
$this
->drupalLogin($this->registered_user);
$this
->drupalGet('user/' . $this->content_user->uid . '/contact');
$this
->assertTheme('bartik');
$this
->drupalLogout();
$this
->drupalLogin($this->content_user);
$this
->drupalGet('node/add');
$this
->assertTheme('bartik');
$this
->drupalGet('node/add/article');
$this
->assertTheme('bartik');
$node = $this
->drupalCreateNode();
$this
->drupalGet('node/' . $node->nid);
$this
->assertTheme('bartik');
$this
->drupalGet('user');
$this
->assertTheme('bartik');
$this
->drupalGet('user/' . $this->content_user->uid);
$this
->assertTheme('bartik');
$this
->setThemeForOwnContent('garland');
$this
->drupalGet('node/add');
$this
->assertTheme('garland');
$this
->drupalGet('node/add/article');
$this
->assertTheme('garland');
$this
->drupalGet('node/' . $node->nid);
$this
->assertTheme('garland');
$this
->drupalGet('');
// front page
$this
->assertTheme('bartik');
$this
->drupalGet('user');
$this
->assertTheme('garland');
$this
->drupalGet('user/' . $this->content_user->uid);
$this
->assertTheme('garland');
$this
->drupalLogout();
$this
->drupalGet('node/' . $node->nid);
$this
->assertTheme('garland');
$this
->drupalGet('');
// front page
$this
->assertTheme('bartik');
$this
->drupalGet('user');
// user login form when anonymous
$this
->assertTheme('bartik');
$this
->drupalGet('user/' . $this->content_user->uid);
$this
->assertTheme('garland');
$this
->drupalLogin($this->registered_user);
$this
->drupalGet('node/' . $node->nid);
$this
->assertTheme('garland');
$this
->drupalGet('');
// front page
$this
->assertTheme('bartik');
$this
->drupalGet('user');
// user login form when anonymous
$this
->assertTheme('bartik');
$this
->drupalGet('user/' . $this->content_user->uid);
$this
->assertTheme('garland');
$this
->drupalGet('user/' . $this->content_user->uid . '/contact');
$this
->assertTheme('garland');
}