1 menu.test MenuRouterTestCase::testThemeCallbackHookCustomTheme()

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

File

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

Class

MenuRouterTestCase

Code

function testThemeCallbackHookCustomTheme() {
  // Trigger hook_custom_theme() to dynamically request the Stark theme for
  // the requested page.
  state_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->backdropGet('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/css/style.css', "The Seven theme's CSS appears on the page.");
}