function ScaffoldTest::scaffoldSut

Same name in other branches
  1. 8.9.x core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ScaffoldTest.php \Drupal\Tests\Composer\Plugin\Scaffold\Functional\ScaffoldTest::scaffoldSut()
  2. 10 core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ScaffoldTest.php \Drupal\Tests\Composer\Plugin\Scaffold\Functional\ScaffoldTest::scaffoldSut()
  3. 11.x core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ScaffoldTest.php \Drupal\Tests\Composer\Plugin\Scaffold\Functional\ScaffoldTest::scaffoldSut()

Creates the system-under-test and runs a scaffold operation on it.

Parameters

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

bool $is_link: Whether to use symlinks for 'replace' operations.

bool $relocated_docroot: Whether the named fixture has a relocated document root.

6 calls to ScaffoldTest::scaffoldSut()
ScaffoldTest::testDrupalDrupalFileWasAppended in core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ScaffoldTest.php
Tests a fixture where the robots.txt file is prepended / appended to.
ScaffoldTest::testDrupalDrupalFileWasReplaced in core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ScaffoldTest.php
Asserts that the appropriate file was replaced.
ScaffoldTest::testEmptyProject in core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ScaffoldTest.php
Try to scaffold a project that does not scaffold anything.
ScaffoldTest::testProjectThatScaffoldsEmptyProject in core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ScaffoldTest.php
Try to scaffold a project that allows a project with no scaffold files.
ScaffoldTest::testScaffoldOverridingSettingsExcludingHtaccess in core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ScaffoldTest.php
Asserts that the drupal/assets scaffold files correct for sut.

... See full list

File

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

Class

ScaffoldTest
Tests Composer Scaffold.

Namespace

Drupal\Tests\Composer\Plugin\Scaffold\Functional

Code

public function scaffoldSut($fixture_name, $is_link = FALSE, $relocated_docroot = TRUE) {
    $sut = $this->createSut($fixture_name, [
        'SYMLINK' => $is_link ? 'true' : 'false',
    ]);
    // Run composer install to get the dependencies we need to test.
    $this->fixtures
        ->runComposer("install --no-ansi --no-scripts --no-plugins", $sut);
    // Test drupal:scaffold.
    $scaffoldOutput = $this->fixtures
        ->runScaffold($sut);
    // Calculate the docroot directory and assert that our fixture layout
    // matches what was stipulated in $relocated_docroot. Fail fast if
    // the caller provided the wrong value.
    $docroot = $sut;
    if ($relocated_docroot) {
        $docroot .= '/docroot';
        $this->assertFileExists($docroot);
    }
    else {
        $this->assertFileDoesNotExist($sut . '/docroot');
    }
    return new ScaffoldTestResult($docroot, $scaffoldOutput);
}

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