You are here

private function GenerateThemeTest::assertThemeExists in Drupal 10

Asserts the theme exists. Returns the parsed *.info.yml file.

Parameters

string $theme_path_relative: The core-relative path to the theme.

Return value

array The parsed *.info.yml file.

5 calls to GenerateThemeTest::assertThemeExists()
GenerateThemeTest::test in core/tests/Drupal/Tests/Core/Command/GenerateThemeTest.php
Tests the generate-theme command.
GenerateThemeTest::testContribStarterkit in core/tests/Drupal/Tests/Core/Command/GenerateThemeTest.php
Tests the generate-theme command on a theme with a release version number.
GenerateThemeTest::testContribStarterkitDevSnapshot in core/tests/Drupal/Tests/Core/Command/GenerateThemeTest.php
Tests the generate-theme command on a theme with a dev version number.
GenerateThemeTest::testCustomStarterkit in core/tests/Drupal/Tests/Core/Command/GenerateThemeTest.php
Tests the generate-theme command on a theme without a version number.
GenerateThemeTest::testDevSnapshot in core/tests/Drupal/Tests/Core/Command/GenerateThemeTest.php
Tests the generate-theme command on a dev snapshot of Drupal core.

File

core/tests/Drupal/Tests/Core/Command/GenerateThemeTest.php, line 71

Class

GenerateThemeTest
Tests the generate-theme commands.

Namespace

Drupal\Tests\Core\Command

Code

private function assertThemeExists(string $theme_path_relative) : array {
  $theme_path_absolute = $this
    ->getWorkspaceDirectory() . "/{$theme_path_relative}";
  $theme_name = basename($theme_path_relative);
  $info_yml_filename = "{$theme_name}.info.yml";
  $this
    ->assertFileExists($theme_path_absolute . '/' . $info_yml_filename);
  $info = Yaml::decode(file_get_contents($theme_path_absolute . '/' . $info_yml_filename));
  return $info;
}