function ThemeInstallerTest::testEmpty

Same name in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/Theme/ThemeInstallerTest.php \Drupal\KernelTests\Core\Theme\ThemeInstallerTest::testEmpty()
  2. 8.9.x core/tests/Drupal/KernelTests/Core/Theme/ThemeInstallerTest.php \Drupal\KernelTests\Core\Theme\ThemeInstallerTest::testEmpty()
  3. 10 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 50

Class

ThemeInstallerTest
Tests installing and uninstalling of themes.

Namespace

Drupal\KernelTests\Core\Theme

Code

public function testEmpty() : void {
    $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->extensionListTheme()
        ->reset()
        ->getList()['stark'], 'ThemeExtensionList::getList() 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.