function ThemeEngineTest::testThemeEngineDeprecation

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

Tests deprecated theme engine .engine files.

File

core/modules/system/tests/src/Kernel/Theme/ThemeEngineTest.php, line 33

Class

ThemeEngineTest
Tests theme engine functionality.

Namespace

Drupal\Tests\system\Kernel\Theme

Code

public function testThemeEngineDeprecation() : void {
  $this->expectDeprecation('Using .engine files for theme engines is deprecated in drupal:11.3.0 and is removed from drupal:12.0.0. Convert test_theme_engine.engine to a service. See https://www.drupal.org/node/3547356');
  \Drupal::service('theme.initialization')->initTheme('test_theme_engine_theme');
  // Ensure that \Drupal\Core\Theme\ThemeManager::getThemeEngine() does not
  // error when the theme engine service is not found.
  $this->assertNull(\Drupal::service('theme.manager')->getThemeEngine('test_theme_engine_theme'));
}

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