You are here

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

Runs the scaffold operation.

This is equivalent to running `composer composer-scaffold`, but we do the equivalent operation by instantiating a Handler object in order to continue running in the same process, so that coverage may be calculated for the code executed by these tests.

Parameters

string $cwd: The working directory to run the scaffold command in.

Return value

string Output captured from tests that write to Fixtures::io().

File

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

Class

Fixtures
Convenience class for creating fixtures.

Namespace

Drupal\Tests\Composer\Plugin\Scaffold

Code

public function runScaffold($cwd) {
  chdir($cwd);
  $handler = new Handler($this
    ->getComposer(), $this
    ->io());
  $handler
    ->scaffold();
  return $this
    ->getOutput();
}