1.20.x system.test SystemThemeFunctionalTest::testSwitchDefaultTheme()

Test switching the default theme.

File

modules/system/tests/system.test, line 1807
Tests for system.module.

Class

SystemThemeFunctionalTest
Tests for the theme interface functionality.

Code

function testSwitchDefaultTheme() {
  // Enable Basis and set it as the default theme.
  theme_enable(array('basis'));
  $this->backdropGet('admin/appearance');
  $this->clickLink(t('Set default'));
  $this->assertEqual(config_get('system.core', 'theme_default'), 'basis');

  // Enable the first disabled theme (Bartik) and check again.
  $this->backdropGet('admin/appearance');
  $this->clickLink(t('Enable and set default'), 0);
  $this->assertEqual(config_get('system.core', 'theme_default'), 'bartik');
}