function GenerateThemeTest::testDeleteDirectory

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

File

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

Class

GenerateThemeTest
Tests the generate-theme commands.

Namespace

Drupal\BuildTests\Command

Code

public function testDeleteDirectory() : void {
    $this->writeStarterkitConfig([
        'ignore' => [
            '/src/*',
            '/starterkit_theme.starterkit.yml',
        ],
    ]);
    $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');
    $theme_path_absolute = $this->getWorkspaceDirectory() . '/themes/test_custom_theme';
    self::assertDirectoryExists($theme_path_absolute);
    self::assertFileDoesNotExist($theme_path_absolute . '/src/StarterKit.php');
    self::assertDirectoryDoesNotExist($theme_path_absolute . '/src');
}

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