function ManageGitIgnoreTest::testUnmanagedGitIgnoreWhenDisabled

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

Tests scaffold command does not manage the .gitignore file when disabled.

File

core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ManageGitIgnoreTest.php, line 148

Class

ManageGitIgnoreTest
Tests to see whether .gitignore files are correctly managed.

Namespace

Drupal\Tests\Composer\Plugin\Scaffold\Functional

Code

public function testUnmanagedGitIgnoreWhenDisabled() {
    // Note that the drupal-drupal fixture has a configuration setting
    // `"gitignore": false,` which disables .gitignore file handling.
    $sut = $this->createSutWithGit('drupal-drupal');
    $this->assertFileDoesNotExist($sut . '/docroot/autoload.php');
    $this->assertFileDoesNotExist($sut . '/docroot/index.php');
    // Run the scaffold command.
    $this->fixtures
        ->runScaffold($sut);
    $this->assertFileExists($sut . '/autoload.php');
    $this->assertFileExists($sut . '/index.php');
    $this->assertFileDoesNotExist($sut . '/.gitignore');
    $this->assertFileDoesNotExist($sut . '/docroot/sites/default/.gitignore');
}

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