You are here

protected function BuildTestBase::setUp in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/BuildTests/Framework/BuildTestBase.php \Drupal\BuildTests\Framework\BuildTestBase::setUp()
1 call to BuildTestBase::setUp()
GenerateThemeTest::setUp in core/tests/Drupal/Tests/Core/Command/GenerateThemeTest.php
1 method overrides BuildTestBase::setUp()
GenerateThemeTest::setUp in core/tests/Drupal/Tests/Core/Command/GenerateThemeTest.php

File

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

Class

BuildTestBase
Provides a workspace to test build processes.

Namespace

Drupal\BuildTests\Framework

Code

protected function setUp() {
  parent::setUp();
  static::checkMethodCommandRequirements($this
    ->getName());
  $this->phpFinder = new PhpExecutableFinder();

  // Set up the workspace directory.
  // @todo Glean working directory from env vars, etc.
  $fs = new SymfonyFilesystem();
  $this->workspaceDir = $fs
    ->tempnam(DrupalFilesystem::getOsTemporaryDirectory(), '/build_workspace_' . md5($this
    ->getName() . microtime(TRUE)));
  $fs
    ->remove($this->workspaceDir);
  $fs
    ->mkdir($this->workspaceDir);
  $this
    ->initMink();
}