You are here

function ThemeInstallerTest::testInstall in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/src/Tests/Extension/ThemeInstallerTest.php \Drupal\system\Tests\Extension\ThemeInstallerTest::testInstall()

Tests installing a theme.

File

core/modules/system/src/Tests/Extension/ThemeInstallerTest.php, line 60
Contains \Drupal\system\Tests\Extension\ThemeInstallerTest.

Class

ThemeInstallerTest
Tests installing and uninstalling of themes.

Namespace

Drupal\system\Tests\Extension

Code

function testInstall() {
  $name = 'test_basetheme';
  $themes = $this
    ->themeHandler()
    ->listInfo();
  $this
    ->assertFalse(isset($themes[$name]));
  $this
    ->themeInstaller()
    ->install(array(
    $name,
  ));
  $this
    ->assertIdentical($this
    ->extensionConfig()
    ->get("theme.{$name}"), 0);
  $themes = $this
    ->themeHandler()
    ->listInfo();
  $this
    ->assertTrue(isset($themes[$name]));
  $this
    ->assertEqual($themes[$name]
    ->getName(), $name);
  $this
    ->assertEqual(array_keys(system_list('theme')), array_keys($themes));

  // Verify that test_basetheme.settings is active.
  $this
    ->assertIdentical(theme_get_setting('features.favicon', $name), FALSE);
  $this
    ->assertEqual(theme_get_setting('base', $name), 'only');
  $this
    ->assertEqual(theme_get_setting('override', $name), 'base');
}