You are here

function MenuIncTestCase::testThemeCallbackOptionalTheme in SimpleTest 7

Test the theme callback when it is set to use an optional theme.

File

tests/menu.test, line 75
Provides SimpleTests for menu.inc.

Class

MenuIncTestCase
@file Provides SimpleTests for menu.inc.

Code

function testThemeCallbackOptionalTheme() {

  // Request a theme that is not enabled.
  $this
    ->drupalGet('menu-test/theme-callback/use-stark-theme');
  $this
    ->assertText('Requested theme: stark. Actual theme: garland.', t('The theme callback system falls back on the default theme when a theme that is not enabled is requested.'));
  $this
    ->assertRaw('garland/style.css', t("The default theme's CSS appears on the page."));

  // Now enable the theme and request it again.
  $admin_user = $this
    ->drupalCreateUser(array(
    'administer site configuration',
  ));
  $this
    ->drupalLogin($admin_user);
  $this
    ->drupalPost('admin/appearance', array(
    'status[stark]' => 1,
  ), t('Save configuration'));
  $this
    ->drupalLogout();
  $this
    ->drupalGet('menu-test/theme-callback/use-stark-theme');
  $this
    ->assertText('Requested theme: stark. Actual theme: stark.', t('The theme callback system uses an optional theme once it has been enabled.'));
  $this
    ->assertRaw('stark/layout.css', t("The optional theme's CSS appears on the page."));
}