function ThemeInstallerTest::testEmpty

Same name in other branches
  1. 8.9.x core/tests/Drupal/KernelTests/Core/Theme/ThemeInstallerTest.php \Drupal\KernelTests\Core\Theme\ThemeInstallerTest::testEmpty()
  2. 10 core/tests/Drupal/KernelTests/Core/Theme/ThemeInstallerTest.php \Drupal\KernelTests\Core\Theme\ThemeInstallerTest::testEmpty()
  3. 11.x core/tests/Drupal/KernelTests/Core/Theme/ThemeInstallerTest.php \Drupal\KernelTests\Core\Theme\ThemeInstallerTest::testEmpty()

Verifies that no themes are installed by default.

File

core/tests/Drupal/KernelTests/Core/Theme/ThemeInstallerTest.php, line 48

Class

ThemeInstallerTest
Tests installing and uninstalling of themes.

Namespace

Drupal\KernelTests\Core\Theme

Code

public function testEmpty() {
    $this->assertEmpty($this->extensionConfig()
        ->get('theme'));
    $this->assertEmpty(array_keys($this->themeHandler()
        ->listInfo()));
    $this->assertEmpty(array_keys(\Drupal::service('theme_handler')->listInfo()));
    // Rebuilding available themes should always yield results though.
    $this->assertNotEmpty($this->themeHandler()
        ->rebuildThemeData()['stark'], 'ThemeHandler::rebuildThemeData() yields all available themes.');
    // theme_get_setting() should return global default theme settings.
    $this->assertTrue(theme_get_setting('features.favicon'));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.