You are here

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

Gets a path to a source scaffold fixture.

Use in place of ScaffoldFilePath::sourcePath().

Parameters

string $project_name: The name of the project to fetch; $package_name is "fixtures/$project_name".

string $source: The name of the asset; path is "assets/$source".

Return value

\Drupal\Composer\Plugin\Scaffold\ScaffoldFilePath The full and relative path to the desired asset

See also

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

2 calls to Fixtures::sourcePath()
Fixtures::appendOp in core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Fixtures.php
Creates an AppendOp fixture.
Fixtures::replaceOp in core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Fixtures.php
Creates a ReplaceOp fixture.

File

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

Class

Fixtures
Convenience class for creating fixtures.

Namespace

Drupal\Tests\Composer\Plugin\Scaffold

Code

public function sourcePath($project_name, $source) {
  $package_name = "fixtures/{$project_name}";
  $source_rel_path = "assets/{$source}";
  $package_path = $this
    ->projectFixtureDir($project_name);
  return ScaffoldFilePath::sourcePath($package_name, $package_path, 'unknown', $source_rel_path);
}