function MenuRouterTestCase::testThemeCallbackHookCustomTheme

Test that the theme callback wins out over hook_custom_theme().

File

modules/simpletest/tests/menu.test, line 307

Class

MenuRouterTestCase

Code

function testThemeCallbackHookCustomTheme() {
  // 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',
  ));
  // The menu "theme callback" should take precedence over a value set in
  // hook_custom_theme().
  $this->drupalGet('menu-test/theme-callback/use-admin-theme');
  $this->assertText('Custom theme: seven. Actual theme: seven.', 'The result of hook_custom_theme() does not override what was set in a theme callback.');
  $this->assertRaw('seven/style.css', "The Seven theme's CSS appears on the page.");
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.