You are here

protected function BuildTestBase::setUp in Drupal 8

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

File

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

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();
}