You are here

public function ComposerProjectTemplatesTest::testMinimumStabilityStrictness in Drupal 9

Make sure that static::MINIMUM_STABILITY is sufficiently strict.

File

core/tests/Drupal/BuildTests/Composer/Template/ComposerProjectTemplatesTest.php, line 88

Class

ComposerProjectTemplatesTest
Demonstrate that Composer project templates are buildable as patched.

Namespace

Drupal\BuildTests\Composer\Template

Code

public function testMinimumStabilityStrictness() {

  // Ensure that static::MINIMUM_STABILITY is not less stable than the
  // current core stability. For example, if we've already released a beta on
  // the branch, ensure that we no longer allow alpha dependencies.
  $this
    ->assertGreaterThanOrEqual(array_search($this
    ->getCoreStability(), static::STABILITY_ORDER), array_search(static::MINIMUM_STABILITY, static::STABILITY_ORDER));

  // Ensure that static::MINIMUM_STABILITY is the same as the least stable
  // dependency.
  // - We can't set it stricter than our least stable dependency.
  // - We don't want to set it looser than we need to, because we don't want
  //   to in the future accidentally commit a dependency that regresses our
  //   actual stability requirement without us explicitly changing this
  //   constant.
  $this
    ->assertSame($this
    ->getLowestDependencyStability(), static::MINIMUM_STABILITY);
}