Test the theme callback when it is set to use an optional theme.
function testThemeCallbackOptionalTheme() {
// Request a theme that is not enabled.
$this
->drupalGet('menu-test/theme-callback/use-stark-theme');
$this
->assertText('Custom theme: NONE. Actual theme: bartik.', 'The theme callback system falls back on the default theme when a theme that is not enabled is requested.');
$this
->assertRaw('bartik/css/style.css', "The default theme's CSS appears on the page.");
// Now enable the theme and request it again.
theme_enable(array(
$this->alternate_theme,
));
$this
->drupalGet('menu-test/theme-callback/use-stark-theme');
$this
->assertText('Custom theme: stark. Actual theme: stark.', 'The theme callback system uses an optional theme once it has been enabled.');
$this
->assertRaw('stark/css/layout.css', "The optional theme's CSS appears on the page.");
}