You are here

function ThemeInstallerTest::testInstallSubTheme 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::testInstallSubTheme()

Tests installing a sub-theme.

File

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

Class

ThemeInstallerTest
Tests installing and uninstalling of themes.

Namespace

Drupal\system\Tests\Extension

Code

function testInstallSubTheme() {
  $name = 'test_subtheme';
  $base_name = 'test_basetheme';
  $themes = $this
    ->themeHandler()
    ->listInfo();
  $this
    ->assertFalse(array_keys($themes));
  $this
    ->themeInstaller()
    ->install(array(
    $name,
  ));
  $themes = $this
    ->themeHandler()
    ->listInfo();
  $this
    ->assertTrue(isset($themes[$name]));
  $this
    ->assertTrue(isset($themes[$base_name]));
  $this
    ->themeInstaller()
    ->uninstall(array(
    $name,
  ));
  $themes = $this
    ->themeHandler()
    ->listInfo();
  $this
    ->assertFalse(isset($themes[$name]));
  $this
    ->assertTrue(isset($themes[$base_name]));
}