Issue #3364885 by andy-blum, mglaman, alexpott, mherchel, lauriii, smustgrave,...
Issue #3364885 by andy-blum, mglaman, alexpott, mherchel, lauriii, smustgrave, isholgueras, Dave Reid, kostyashupenko, matthieuscarset, camoa, ctrlADel, fjgarlin, jwilson3: Allow themes to use a starterkit.yml file so it is easier to use the theme generator
(cherry picked from commit 6c2ed729)
$this->assertSame('test_custom_theme theme, generated from starterkit_theme. Additional information on generating themes can be found in the [Starterkit documentation](https://www.drupal.org/docs/core-modules-and-themes/core-themes/starterkit-theme).',file_get_contents($readme_file));
$this->assertSame('"Testcustom starterkit theme" theme, generated from starterkit_theme. Additional information on generating themes can be found in the [Starterkit documentation](https://www.drupal.org/docs/core-modules-and-themes/core-themes/starterkit-theme).',file_get_contents($readme_file));
// Ensure that the generated theme can be installed.
$this->installQuickStart('minimal');
@@ -141,8 +144,18 @@ public function testGeneratingFromAnotherTheme() {
$process=$this->generateThemeFromStarterkit();
$exit_code=$process->run();
$this->assertSame('Theme generated successfully to themes/test_custom_theme',trim($process->getOutput()),$process->getErrorOutput());
$this->assertStringContainsString('Theme generated successfully to themes/test_custom_theme',trim($process->getOutput()),$process->getErrorOutput());
@@ -154,12 +167,12 @@ public function testGeneratingFromAnotherTheme() {
];
$process=newProcess($install_command);
$exit_code=$process->run();
$this->assertSame('Theme generated successfully to themes/generated_from_another_theme',trim($process->getOutput()),$process->getErrorOutput());
$this->assertStringContainsString('Theme generated successfully to themes/generated_from_another_theme',trim($process->getOutput()),$process->getErrorOutput());
$this->assertSame('generated_from_another_theme theme, generated from test_custom_theme. Additional information on generating themes can be found in the [Starterkit documentation](https://www.drupal.org/docs/core-modules-and-themes/core-themes/starterkit-theme).',file_get_contents($readme_file));
@@ -224,7 +237,7 @@ public function testContribStarterkitDevSnapshot(): void {
$process=$this->generateThemeFromStarterkit();
$result=$process->run();
$this->assertEquals("The source theme starterkit_theme has a development version number (7.x-dev). Because it is not a git checkout, a specific commit could not be identified. This makes tracking changes in the source theme difficult. Are you sure you want to continue? (yes/no) [yes]:\n > Theme generated successfully to themes/test_custom_theme",trim($process->getOutput()),$process->getErrorOutput());
$this->assertStringContainsString("The source theme starterkit_theme has a development version number (7.x-dev). Because it is not a git checkout, a specific commit could not be identified. This makes tracking changes in the source theme difficult. Are you sure you want to continue? (yes/no) [yes]:\n > Theme generated successfully to themes/test_custom_theme",trim($process->getOutput()),$process->getErrorOutput());
$this->assertEquals("[ERROR] The source theme starterkit_theme has a development version number \n (7.x-dev). Determining a specific commit is not possible because git is\n not installed. Either install git or use a tagged release to generate a\n theme.",trim($process->getOutput()),$process->getErrorOutput());
$this->assertEquals("[ERROR] The source theme starterkit_theme has a development version number \n (7.x-dev). Determining a specific commit is not possible because git is\n not installed. Either install git or use a tagged release to generate a\n theme.",trim($process->getErrorOutput()),$process->getErrorOutput());
@@ -296,7 +309,7 @@ public function testCustomStarterkit(): void {
$process=$this->generateThemeFromStarterkit();
$result=$process->run();
$this->assertEquals("The source theme starterkit_theme does not have a version specified. This makes tracking changes in the source theme difficult. Are you sure you want to continue? (yes/no) [yes]:\n > Theme generated successfully to themes/test_custom_theme",trim($process->getOutput()),$process->getErrorOutput());
$this->assertStringContainsString("The source theme starterkit_theme does not have a version specified. This makes tracking changes in the source theme difficult. Are you sure you want to continue? (yes/no) [yes]:\n > Theme generated successfully to themes/test_custom_theme",trim($process->getOutput()),$process->getErrorOutput());
file_put_contents($readme_file,"$theme_name theme, generated from starterkit_theme. Additional information on generating themes can be found in the [Starterkit documentation](https://www.drupal.org/docs/core-modules-and-themes/core-themes/starterkit-theme).");