You are here

protected function BuildTestBase::getWorkingPath in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/BuildTests/Framework/BuildTestBase.php \Drupal\BuildTests\Framework\BuildTestBase::getWorkingPath()

Get the working directory within the workspace, creating if necessary.

Parameters

string $working_dir: The path within the workspace directory.

Return value

string The full path to the working directory within the workspace directory.

3 calls to BuildTestBase::getWorkingPath()
BuildTestBase::copyCodebase in core/tests/Drupal/BuildTests/Framework/BuildTestBase.php
Copy the current working codebase into a workspace.
BuildTestBase::instantiateServer in core/tests/Drupal/BuildTests/Framework/BuildTestBase.php
Do the work of making a server process.
GenerateThemeTest::setUp in core/tests/Drupal/Tests/Core/Command/GenerateThemeTest.php

File

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

Class

BuildTestBase
Provides a workspace to test build processes.

Namespace

Drupal\BuildTests\Framework

Code

protected function getWorkingPath($working_dir = NULL) {
  $full_path = $this
    ->getWorkspaceDirectory();
  if ($working_dir) {
    $full_path .= '/' . $working_dir;
  }
  if (!file_exists($full_path)) {
    $fs = new SymfonyFilesystem();
    $fs
      ->mkdir($full_path);
  }
  return $full_path;
}