function ThemeInstallerTest::testInstallDeprecated

Same name in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/Theme/ThemeInstallerTest.php \Drupal\KernelTests\Core\Theme\ThemeInstallerTest::testInstallDeprecated()
  2. 11.x core/tests/Drupal/KernelTests/Core/Theme/ThemeInstallerTest.php \Drupal\KernelTests\Core\Theme\ThemeInstallerTest::testInstallDeprecated()

Tests trying to install a deprecated theme.

@covers \Drupal\Core\Extension\ThemeInstaller::install

@group legacy

File

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

Class

ThemeInstallerTest
Tests installing and uninstalling of themes.

Namespace

Drupal\KernelTests\Core\Theme

Code

public function testInstallDeprecated() : void {
    $this->expectDeprecation("The theme 'deprecated_theme_test' is deprecated. See https://example.com/deprecated");
    $this->themeInstaller()
        ->install([
        'deprecated_theme_test',
    ]);
    $this->assertTrue(\Drupal::service('theme_handler')->themeExists('deprecated_theme_test'));
}

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