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.
Deprecated
in drupal:12.0.0 and is removed from drupal:13.0.0. Access $this->root directly.
See also
https://www.drupal.org/node/3574112
File
-
core/
tests/ Drupal/ Tests/ TestRequirementsTrait.php, line 34
Class
- TestRequirementsTrait
- Allows test classes to require Drupal modules as dependencies.
Namespace
Drupal\TestsCode
protected static function getDrupalRoot() : string {
@trigger_error(__METHOD__ . '() is deprecated in drupal:12.0.0 and is removed from drupal:13.0.0. Access $this->root directly. See https://www.drupal.org/node/3574112', E_USER_DEPRECATED);
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.