function TestRequirementsTrait::getDrupalRoot
Same name and namespace in other branches
- 11.x core/tests/Drupal/Tests/TestRequirementsTrait.php \Drupal\Tests\TestRequirementsTrait::getDrupalRoot()
- 10 core/tests/Drupal/Tests/TestRequirementsTrait.php \Drupal\Tests\TestRequirementsTrait::getDrupalRoot()
- 9 core/tests/Drupal/Tests/TestRequirementsTrait.php \Drupal\Tests\TestRequirementsTrait::getDrupalRoot()
- 8.9.x core/tests/Drupal/Tests/TestRequirementsTrait.php \Drupal\Tests\TestRequirementsTrait::getDrupalRoot()
Returns the Drupal root directory.
Return value
string The Drupal root directory.
3 calls to TestRequirementsTrait::getDrupalRoot()
- OEmbedSourceTest::testThumbnailUri in core/
modules/ media/ tests/ src/ Kernel/ OEmbedSourceTest.php - Tests that remote thumbnails are downloaded correctly.
- SymlinkValidatorTest::testSymlinksWithinSamePackage in core/
modules/ package_manager/ tests/ src/ Kernel/ SymlinkValidatorTest.php - Tests that relative symlinks within the same package are supported.
- SymlinkValidatorTest::testSymlinkToDirectory in core/
modules/ package_manager/ tests/ src/ Kernel/ SymlinkValidatorTest.php - Tests what happens when there is a symlink to a directory.
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.