function BuildTestBase::getWorkingPathDrupalRoot

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

Gets the working path for Drupal core.

Return value

string|null The relative path to Drupal's root directory or NULL if it is the same as the composer root directory.

2 calls to BuildTestBase::getWorkingPathDrupalRoot()
BuildTestBase::getCodebaseFinder in core/tests/Drupal/BuildTests/Framework/BuildTestBase.php
Get a default Finder object for a Drupal codebase.
BuildTestBase::getWorkspaceDrupalRoot in core/tests/Drupal/BuildTests/Framework/BuildTestBase.php
Gets the path to Drupal root in the workspace directory.

File

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

Class

BuildTestBase
Provides a workspace to test build processes.

Namespace

Drupal\BuildTests\Framework

Code

public function getWorkingPathDrupalRoot() : ?string {
    $composer_root = $this->getComposerRoot();
    $drupal_root = $this->getDrupalRoot();
    if ($composer_root === $drupal_root) {
        return NULL;
    }
    return (new SymfonyFilesystem())->makePathRelative($drupal_root, $composer_root);
}

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