function ExtensionListTestTrait::getModulePath

Same name in other branches
  1. 9 core/tests/Drupal/Tests/ExtensionListTestTrait.php \Drupal\Tests\ExtensionListTestTrait::getModulePath()
  2. 11.x core/tests/Drupal/Tests/ExtensionListTestTrait.php \Drupal\Tests\ExtensionListTestTrait::getModulePath()

Gets the path for the specified module.

Parameters

string $module_name: The module name.

Return value

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

Throws

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

41 calls to ExtensionListTestTrait::getModulePath()
CommentCSSTest::testCommentClasses in core/modules/comment/tests/src/Functional/CommentCSSTest.php
Tests CSS classes on comments.
ConfigInstallProfileOverrideTest::testInstallProfileConfigOverwrite in core/modules/config/tests/src/Functional/ConfigInstallProfileOverrideTest.php
Tests install profile config changes.
CredentialFormTest::testCredentialFrom in core/modules/migrate_drupal_ui/tests/src/Functional/CredentialFormTest.php
Test the credential form.
DbLogTest::testBacktrace in core/modules/dblog/tests/src/Functional/DbLogTest.php
Tests that the details page displays correctly backtrace.
EditorLoadingTest::getThingsToCheck in core/modules/editor/tests/src/Functional/EditorLoadingTest.php

... See full list

File

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

Class

ExtensionListTestTrait
Provides extension list methods.

Namespace

Drupal\Tests

Code

protected function getModulePath(string $module_name) : string {
    return \Drupal::service('extension.list.module')->getPath($module_name);
}

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