function TestRequirementsTrait::getDrupalRoot
Returns the Drupal root directory.
Return value
string
9 calls to TestRequirementsTrait::getDrupalRoot()
- BlockRebuildTest::setUpBeforeClass in core/
modules/ block/ tests/ src/ Kernel/ BlockRebuildTest.php  - ConfigValidationTest::createRecipeWithInvalidDataInFile in core/
tests/ Drupal/ KernelTests/ Core/ Recipe/ ConfigValidationTest.php  - Creates a recipe with invalid config data in a particular file.
 - ContentImportTest::setUp in core/
tests/ Drupal/ FunctionalTests/ DefaultContent/ ContentImportTest.php  - DriverSpecificKernelTestBase::setUp in core/
tests/ Drupal/ KernelTests/ Core/ Database/ DriverSpecificKernelTestBase.php  - FileCopyTest::providerSuccessfulReuse in core/
modules/ migrate/ tests/ src/ Kernel/ process/ FileCopyTest.php  - Provides the source and destination path files.
 
File
- 
              core/
tests/ Drupal/ Tests/ TestRequirementsTrait.php, line 25  
Class
- TestRequirementsTrait
 - Allows test classes to require Drupal modules as dependencies.
 
Namespace
Drupal\TestsCode
protected static function getDrupalRoot() {
  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.