function GenerateThemeTest::testExcludedGitFolder

Same name and namespace in other branches
  1. 11.x core/tests/Drupal/BuildTests/Command/GenerateThemeTest.php \Drupal\BuildTests\Command\GenerateThemeTest::testExcludedGitFolder()

File

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

Class

GenerateThemeTest
Tests the generate-theme commands.

Namespace

Drupal\BuildTests\Command

Code

public function testExcludedGitFolder() : void {
  $path = $this->getWorkspaceDirectory() . '/core/themes/starterkit_theme/.git';
  mkdir($path);
  file_put_contents($path . '/config', '*.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 .git folder is not present in the generated theme.
  $theme_path_absolute = $this->getWorkspaceDirectory() . '/themes/test_custom_theme';
  self::assertFileDoesNotExist($theme_path_absolute . '/.git');
}

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