function GenerateThemeTest::testNoEditMissingFilesWarning

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

File

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

Class

GenerateThemeTest
Tests the generate-theme commands.

Namespace

Drupal\BuildTests\Command

Code

public function testNoEditMissingFilesWarning() : void {
    $this->writeStarterkitConfig([
        'no_edit' => [
            '/js/starterkit_theme.js',
        ],
    ]);
    $tester = $this->runCommand([
        'machine-name' => 'test_custom_theme',
        '--name' => 'Test custom starterkit theme',
        '--description' => 'Custom theme generated from a starterkit theme',
    ]);
    self::assertThat($tester->getStatusCode(), self::logicalNot(new CommandIsSuccessful()), trim($tester->getDisplay()));
    self::assertEquals('[ERROR] Paths were defined `no_edit` but no files found.', trim($tester->getErrorOutput()));
    $theme_path_absolute = $this->getWorkspaceDirectory() . '/themes/test_custom_theme';
    self::assertDirectoryDoesNotExist($theme_path_absolute);
}

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