You are here

public function Fixtures::destinationPath 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::destinationPath()

Gets a destination path in a tmp dir.

Use in place of ScaffoldFilePath::destinationPath().

Parameters

string $destination: Destination path; should be in the form '[web-root]/robots.txt', where '[web-root]' is always literally '[web-root]', with any arbitrarily desired filename following.

\Drupal\Composer\Plugin\Scaffold\Interpolator $interpolator: Location replacements. Obtain via Fixtures::getLocationReplacements() when creating multiple scaffold destinations.

string $package_name: (optional) The name of the fixture package that this path came from. Taken from interpolator if not provided.

Return value

\Drupal\Composer\Plugin\Scaffold\ScaffoldFilePath A destination scaffold file backed by temporary storage.

See also

\Drupal\Composer\Plugin\Scaffold\ScaffoldFilePath::destinationPath()

File

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

Class

Fixtures
Convenience class for creating fixtures.

Namespace

Drupal\Tests\Composer\Plugin\Scaffold

Code

public function destinationPath($destination, Interpolator $interpolator = NULL, $package_name = NULL) {
  $interpolator = $interpolator ?: $this
    ->getLocationReplacements();
  $package_name = $package_name ?: $interpolator
    ->interpolate('[package-name]');
  return ScaffoldFilePath::destinationPath($package_name, $destination, $interpolator);
}