$starterkit_info_yml =
$this->
getWorkspaceDirectory() . '/core/themes/starterkit_theme/starterkit_theme.info.yml';
$info = Yaml::
decode(file_get_contents($starterkit_info_yml));
$info['version'
] = '9.4.0';
file_put_contents($starterkit_info_yml, Yaml::
encode($info));
$process =
$this->
generateThemeFromStarterkit();
$result =
$process->
run();
$this->
assertEquals('Theme generated successfully to themes/test_custom_theme',
trim($process->
getOutput()),
$process->
getErrorOutput());
$this->
assertSame(0,
$result);
$theme_path_relative = 'themes/test_custom_theme';
$info =
$this->
assertThemeExists($theme_path_relative);
self::
assertArrayNotHasKey('hidden',
$info);
self::
assertArrayHasKey('generator',
$info);
self::
assertEquals('starterkit_theme:9.4.0',
$info['generator'
]);
// Confirm readme is rewritten.
$readme_file =
$this->
getWorkspaceDirectory() . "/
$theme_path_relative/README.md";
$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));
// Ensure that the generated theme can be installed.
$this->
installQuickStart('minimal'
);
$this->
formLogin($this->adminUsername,
$this->adminPassword
);