function ExtensionListTestTrait::getThemePath

Same name in other branches
  1. 10 core/tests/Drupal/Tests/ExtensionListTestTrait.php \Drupal\Tests\ExtensionListTestTrait::getThemePath()
  2. 11.x 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.

4 calls to ExtensionListTestTrait::getThemePath()
ThemeInfoTest::testStylesheets in core/modules/system/tests/src/Functional/Theme/ThemeInfoTest.php
Tests stylesheets-remove.
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.
TwigWhiteListTest::testWhiteListChaining in core/tests/Drupal/KernelTests/Core/Theme/TwigWhiteListTest.php
Tests white-listing of methods doesn't interfere with chaining.

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);
}

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