function ExtensionListTestTrait::getModulePath

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

4 calls to ExtensionListTestTrait::getModulePath()
CKEditorLoadingTest::testLoading in core/modules/ckeditor/tests/src/Functional/CKEditorLoadingTest.php
Tests loading of CKEditor CSS, JS and JS settings.
CredentialFormTest::testCredentialFrom in core/modules/migrate_drupal_ui/tests/src/Functional/CredentialFormTest.php
Test the credential form.
FilePathTest::setUp in core/modules/migrate_drupal_ui/tests/src/Functional/d7/FilePathTest.php
Upgrade7Test::setUp in core/modules/rdf/tests/src/Functional/Migrate/Upgrade7Test.php

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

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