You are here

public function ScaffoldTest::testDrupalDrupalFileWasAppended 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::testDrupalDrupalFileWasAppended()
  2. 10 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 345

Class

ScaffoldTest
Tests Composer Scaffold.

Namespace

Drupal\Tests\Composer\Plugin\Scaffold\Functional

Code

public function testDrupalDrupalFileWasAppended($fixture_name, $is_link, $scaffold_file_path, $scaffold_file_contents, $scaffoldOutputContains) {
  $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());
}