function TestRequirementsTrait::getDrupalRoot
Returns the Drupal root directory.
Return value
string The Drupal root directory.
15 calls to TestRequirementsTrait::getDrupalRoot()
- ConfigValidationTest::createRecipeWithInvalidDataInFile in core/
tests/ Drupal/ KernelTests/ Core/ Recipe/ ConfigValidationTest.php - Creates a recipe with invalid config data in a particular file.
- ContentExportTest::setUp in core/
tests/ Drupal/ FunctionalTests/ DefaultContent/ ContentExportTest.php - ContentImportTest::assertContentWasImported in core/
tests/ Drupal/ FunctionalTests/ DefaultContent/ ContentImportTest.php - Asserts that the default content was imported as expected.
- ContentImportTest::setUp in core/
tests/ Drupal/ FunctionalTests/ DefaultContent/ ContentImportTest.php - DriverSpecificKernelTestBase::setUp in core/
tests/ Drupal/ KernelTests/ Core/ Database/ DriverSpecificKernelTestBase.php
File
-
core/
tests/ Drupal/ Tests/ TestRequirementsTrait.php, line 22
Class
- TestRequirementsTrait
- Allows test classes to require Drupal modules as dependencies.
Namespace
Drupal\TestsCode
protected static function getDrupalRoot() : string {
return dirname(substr(__DIR__, 0, -strlen(__NAMESPACE__)), 2);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.