function ThemeDeprecationTest::testThemeExtensionDeprecation

Same name and namespace in other branches
  1. 11.x core/modules/system/tests/src/Kernel/Theme/ThemeDeprecationTest.php \Drupal\Tests\system\Kernel\Theme\ThemeDeprecationTest::testThemeExtensionDeprecation()

Tests that .theme deprecations are emitted.

Attributes

#[IgnoreDeprecations]

File

core/modules/system/tests/src/Kernel/Theme/ThemeDeprecationTest.php, line 23

Class

ThemeDeprecationTest
Tests theme file extension deprecations.

Namespace

Drupal\Tests\system\Kernel\Theme

Code

public function testThemeExtensionDeprecation() : void {
  \Drupal::service('theme_installer')->install([
    'test_theme_discovery_deprecation',
  ]);
  \Drupal::theme()->setActiveTheme(\Drupal::service(ThemeInitializationInterface::class)->initTheme('test_theme_discovery_deprecation'));
  $this->expectUserDeprecationMessage('Using test_theme_discovery_deprecation.theme is deprecated in drupal:11.5.0 and is removed from drupal:13.0.0. Use classes instead. See https://www.drupal.org/node/3581222');
}

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