You are here

public function Fixtures::tmpDir in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Fixtures.php \Drupal\Tests\Composer\Plugin\Scaffold\Fixtures::tmpDir()
  2. 10 core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Fixtures.php \Drupal\Tests\Composer\Plugin\Scaffold\Fixtures::tmpDir()

Generates a path to a temporary location, but do not create the directory.

Parameters

string $prefix: A prefix for the temporary directory name.

Return value

string Path to temporary directory

1 call to Fixtures::tmpDir()
Fixtures::mkTmpDir in core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Fixtures.php
Creates a temporary directory.

File

core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Fixtures.php, line 253

Class

Fixtures
Convenience class for creating fixtures.

Namespace

Drupal\Tests\Composer\Plugin\Scaffold

Code

public function tmpDir($prefix) {
  $prefix .= static::persistentPrefix();
  $tmpDir = sys_get_temp_dir() . '/scaffold-' . $prefix . uniqid(md5($prefix . microtime()), TRUE);
  $this->tmpDirs[] = $tmpDir;
  return $tmpDir;
}