MenuRouterTestCase::testHookCustomTheme

7 menu.test MenuRouterTestCase::testHookCustomTheme()
8 menu.test MenuRouterTestCase::testHookCustomTheme()

Test that hook_custom_theme() can control the theme of a page.

File

modules/simpletest/tests/menu.test, line 291
Provides SimpleTests for menu.inc.

Code

function testHookCustomTheme() {
  // Trigger hook_custom_theme() to dynamically request the Stark theme for
  // the requested page.
  variable_set('menu_test_hook_custom_theme_name', 'stark');
  theme_enable(array('stark'));

  // Visit a page that does not implement a theme callback. The above request
  // should be honored.
  $this->drupalGet('menu-test/no-theme-callback');
  $this->assertText('Custom theme: stark. Actual theme: stark.', t('The result of hook_custom_theme() is used as the theme for the current page.'));
  $this->assertRaw('stark/layout.css', t("The Stark theme's CSS appears on the page."));
}
Login or register to post comments