You are here

protected function ScaffoldTest::createSut in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ScaffoldTest.php \Drupal\Tests\Composer\Plugin\Scaffold\Functional\ScaffoldTest::createSut()
  2. 10 core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ScaffoldTest.php \Drupal\Tests\Composer\Plugin\Scaffold\Functional\ScaffoldTest::createSut()

Creates the System-Under-Test.

Parameters

string $fixture_name: The name of the fixture to use from core/tests/Drupal/Tests/Component/Scaffold/fixtures.

array $replacements: Key : value mappings for placeholders to replace in composer.json templates.

Return value

string The path to the created System-Under-Test.

1 call to ScaffoldTest::createSut()
ScaffoldTest::scaffoldSut in core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ScaffoldTest.php
Creates the system-under-test and runs a scaffold operation on it.

File

core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ScaffoldTest.php, line 93

Class

ScaffoldTest
Tests Composer Scaffold.

Namespace

Drupal\Tests\Composer\Plugin\Scaffold\Functional

Code

protected function createSut($fixture_name, array $replacements = []) {
  $sut = $this->fixturesDir . '/' . $fixture_name;

  // Erase just our sut, to ensure it is clean. Recopy all of the fixtures.
  $this->fileSystem
    ->remove($sut);
  $replacements += [
    'PROJECT_ROOT' => $this->projectRoot,
  ];
  $this->fixtures
    ->cloneFixtureProjects($this->fixturesDir, $replacements);
  return $sut;
}