function GenerateThemeTest::setVersion

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

Set a version in the .info.yml.

4 calls to GenerateThemeTest::setVersion()
GenerateThemeTest::doTestContribStarterkit in core/tests/Drupal/BuildTests/Command/GenerateThemeTest.php
Tests the generate-theme command on a theme with a release version number.
GenerateThemeTest::doTestDevSnapshot in core/tests/Drupal/BuildTests/Command/GenerateThemeTest.php
Tests the generate-theme command on a dev snapshot of Drupal core.
GenerateThemeTest::doTestGenerateTheme in core/tests/Drupal/BuildTests/Command/GenerateThemeTest.php
GenerateThemeTest::doTestGeneratingFromAnotherTheme in core/tests/Drupal/BuildTests/Command/GenerateThemeTest.php
Tests generating a theme from another Starterkit enabled theme.

File

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

Class

GenerateThemeTest
Tests the generate-theme commands.

Namespace

Drupal\BuildTests\Command

Code

protected function setVersion(string $version) : void {
  // Do not rely on \Drupal::VERSION: change the version to a concrete version
  // number, to simulate using a tagged core release.
  $info = $this->originalInfo;
  $info['version'] = $version;
  file_put_contents($this->starterKitInfoYamlLocation, Yaml::encode($info));
}

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