function GenerateThemeTest::testIgnoredDotFiles

File

core/tests/Drupal/BuildTests/Command/GenerateThemeTest.php, line 602

Class

GenerateThemeTest
Tests the generate-theme commands.

Namespace

Drupal\BuildTests\Command

Code

public function testIgnoredDotFiles() : void {
  $this->writeStarterkitConfig([
    'ignore' => [
      '/.npmrc',
    ],
  ]);
  file_put_contents($this->getWorkspaceDirectory() . '/core/themes/starterkit_theme/.npmrc', '*.map');
  $tester = $this->runCommand([
    'machine-name' => 'test_custom_theme',
    '--name' => 'Test custom starterkit theme',
    '--description' => 'Custom theme generated from a starterkit theme',
  ]);
  $tester->assertCommandIsSuccessful($tester->getErrorOutput());
  $this->assertThemeExists('themes/test_custom_theme');
  // Verify that the .npmrc file is not present in the generated theme.
  $theme_path_absolute = $this->getWorkspaceDirectory() . '/themes/test_custom_theme';
  self::assertFileDoesNotExist($theme_path_absolute . '/.npmrc');
}

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