function ExtensionListTestTrait::getModulePath

Same name in other branches
  1. 10 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.

47 calls to ExtensionListTestTrait::getModulePath()
AggregatorTestBase::getAtomSample in core/modules/aggregator/tests/src/Functional/AggregatorTestBase.php
Returns an example Atom feed.
AggregatorTestBase::getHtmlEntitiesSample in core/modules/aggregator/tests/src/Functional/AggregatorTestBase.php
Returns an example feed.
AggregatorTestBase::getRSS091Sample in core/modules/aggregator/tests/src/Functional/AggregatorTestBase.php
Returns an example RSS091 feed.
CKEditorLoadingTest::testLoading in core/modules/ckeditor/tests/src/Functional/CKEditorLoadingTest.php
Tests loading of CKEditor CSS, JS and JS settings.
CKEditorPluginManagerTest::testCssFiles in core/modules/ckeditor/tests/src/Kernel/CKEditorPluginManagerTest.php
Tests the iframe instance CSS files of plugins.

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

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