You are here

protected function ExtensionListTestTrait::getThemePath in Drupal 10

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/ExtensionListTestTrait.php \Drupal\Tests\ExtensionListTestTrait::getThemePath()

Gets the path for the specified theme.

Parameters

string $theme_name: The theme name.

Return value

string The Drupal-root relative path to the theme directory.

Throws

\Drupal\Core\Extension\Exception\UnknownExtensionException If the theme does not exist.

3 calls to ExtensionListTestTrait::getThemePath()
ThemeInfoTest::testStylesheets in core/modules/system/tests/src/Functional/Theme/ThemeInfoTest.php
Tests libraries-override.
ThemeTest::testFindThemeTemplates in core/modules/system/tests/src/Kernel/Theme/ThemeTest.php
Tests drupal_find_theme_templates().
TwigDebugMarkupTest::testTwigDebugMarkup in core/modules/system/tests/src/Functional/Theme/TwigDebugMarkupTest.php
Tests debug markup added to Twig template output.

File

core/tests/Drupal/Tests/ExtensionListTestTrait.php, line 38

Class

ExtensionListTestTrait
Provides extension list methods.

Namespace

Drupal\Tests

Code

protected function getThemePath(string $theme_name) : string {
  return \Drupal::service('extension.list.theme')
    ->getPath($theme_name);
}