You are here

protected function ExtensionListTestTrait::getModulePath in Drupal 10

Same name and namespace in other branches
  1. 9 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.

11 calls to ExtensionListTestTrait::getModulePath()
EntityTypeWithoutViewsDataTest::testEntityTypeWithoutViewsData in core/modules/datetime_range/tests/src/Kernel/Views/EntityTypeWithoutViewsDataTest.php
Tests the case when an entity type provides no views data.
ErrorHandlerTest::testErrorHandler in core/modules/system/tests/src/Functional/System/ErrorHandlerTest.php
Tests the error handler.
ErrorHandlerTest::testExceptionHandler in core/modules/system/tests/src/Functional/System/ErrorHandlerTest.php
Tests the exception handler.
HtaccessTest::getProtectedFiles in core/modules/system/tests/src/Functional/System/HtaccessTest.php
Get an array of file paths for access testing.
ModuleTestBase::assertModuleConfig in core/modules/system/tests/src/Functional/Module/ModuleTestBase.php
Asserts that the default configuration of a module has been installed.

... See full list

File

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

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