You are here

public function ScaffoldTest::testDrupalDrupalFileWasReplaced 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::testDrupalDrupalFileWasReplaced()
  2. 10 core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ScaffoldTest.php \Drupal\Tests\Composer\Plugin\Scaffold\Functional\ScaffoldTest::testDrupalDrupalFileWasReplaced()

Asserts that the appropriate file was replaced.

Check the drupal/drupal-based project to confirm that the expected file was replaced, and that files that were not supposed to be replaced remain unchanged.

File

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

Class

ScaffoldTest
Tests Composer Scaffold.

Namespace

Drupal\Tests\Composer\Plugin\Scaffold\Functional

Code

public function testDrupalDrupalFileWasReplaced() {
  $fixture_name = 'drupal-drupal-test-overwrite';
  $result = $this
    ->scaffoldSut($fixture_name, FALSE, FALSE);
  $this
    ->assertScaffoldedFile($result
    ->docroot() . '/replace-me.txt', FALSE, 'from assets that replaces file');
  $this
    ->assertScaffoldedFile($result
    ->docroot() . '/keep-me.txt', FALSE, 'File in drupal-drupal-test-overwrite that is not replaced');
  $this
    ->assertScaffoldedFile($result
    ->docroot() . '/make-me.txt', FALSE, 'from assets that replaces file');
  $this
    ->assertCommonDrupalAssetsWereScaffolded($result
    ->docroot(), FALSE);
  $this
    ->assertAutoloadFileCorrect($result
    ->docroot());
  $this
    ->assertScaffoldedFile($result
    ->docroot() . '/robots.txt', FALSE, $fixture_name);
}