function ThemeInstallerTest::testInstallDeprecated

Same name in other branches
  1. 10 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 ::install

@group legacy

File

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

Class

ThemeInstallerTest
Tests installing and uninstalling of themes.

Namespace

Drupal\KernelTests\Core\Theme

Code

public function testInstallDeprecated() {
    $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.