function ScaffoldTest::testDrupalDrupalFileWasAppended

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

Tests a fixture where the robots.txt file is prepended / appended to.

@dataProvider scaffoldAppendTestValues

Parameters

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

bool $is_link: Whether or not symlinking should be used.

string $scaffold_file_path: Relative path to the scaffold file target we are testing.

string $scaffold_file_contents: A string expected to be contained inside the scaffold file we are testing.

string $scaffoldOutputContains: A string expected to be contained in the scaffold command output.

File

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

Class

ScaffoldTest
Tests Composer Scaffold.

Namespace

Drupal\Tests\Composer\Plugin\Scaffold\Functional

Code

public function testDrupalDrupalFileWasAppended(string $fixture_name, bool $is_link, string $scaffold_file_path, string $scaffold_file_contents, string $scaffoldOutputContains) : void {
    $result = $this->scaffoldSut($fixture_name, $is_link, FALSE);
    $this->assertStringContainsString($scaffoldOutputContains, $result->scaffoldOutput());
    $this->assertScaffoldedFile($result->docroot() . '/' . $scaffold_file_path, FALSE, $scaffold_file_contents);
    $this->assertCommonDrupalAssetsWereScaffolded($result->docroot(), $is_link);
    $this->assertAutoloadFileCorrect($result->docroot());
}

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