function ScaffoldTest::createSut

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ScaffoldTest.php \Drupal\Tests\Composer\Plugin\Scaffold\Functional\ScaffoldTest::createSut()
  2. 8.9.x core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ScaffoldTest.php \Drupal\Tests\Composer\Plugin\Scaffold\Functional\ScaffoldTest::createSut()
  3. 11.x 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 95

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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.