function BuildTestBase::getDrupalRootStatic

Same name in other branches
  1. 10 core/tests/Drupal/BuildTests/Framework/BuildTestBase.php \Drupal\BuildTests\Framework\BuildTestBase::getDrupalRootStatic()

Get the root path of this Drupal codebase.

Return value

string The full path to the root of this Drupal codebase.

3 calls to BuildTestBase::getDrupalRootStatic()
BuildTestBase::getDrupalRoot in core/tests/Drupal/BuildTests/Framework/BuildTestBase.php
Get the root path of this Drupal codebase.
ComponentsIsolatedBuildTest::provideComponentPaths in core/tests/Drupal/BuildTests/Composer/Component/ComponentsIsolatedBuildTest.php
Provides an array with relative paths to the component paths.
ComposerValidateTest::provideComposerJson in core/tests/Drupal/BuildTests/Composer/ComposerValidateTest.php

File

core/tests/Drupal/BuildTests/Framework/BuildTestBase.php, line 610

Class

BuildTestBase
Provides a workspace to test build processes.

Namespace

Drupal\BuildTests\Framework

Code

public static function getDrupalRootStatic() {
    // Given this code is in the drupal/core package, $core cannot be NULL.
    
    /** @var string $core */
    $core = InstalledVersions::getInstallPath('drupal/core');
    return realpath(dirname($core));
}

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