function TemplateProjectTestBase::unboundCoreConstraints

Changes constraints for core packages to `*`.

Parameters

string[] $constraints: A set of version constraints, like you'd find in the `require` or `require-dev` sections of `composer.json`. This array is modified by reference.

2 calls to TemplateProjectTestBase::unboundCoreConstraints()
TemplateProjectTestBase::createTestProject in core/modules/package_manager/tests/src/Build/TemplateProjectTestBase.php
Creates a test project from a given template and installs Drupal.
TemplateProjectTestBase::createVendorRepository in core/modules/package_manager/tests/src/Build/TemplateProjectTestBase.php
Creates a Composer repository for all dependencies of the test project.

File

core/modules/package_manager/tests/src/Build/TemplateProjectTestBase.php, line 379

Class

TemplateProjectTestBase
Base class for tests which create a test site from a core project template.

Namespace

Drupal\Tests\package_manager\Build

Code

private static function unboundCoreConstraints(array &$constraints) : void {
    $names = preg_grep('/^drupal\\/core-?/', array_keys($constraints));
    foreach ($names as $name) {
        $constraints[$name] = '*';
    }
}

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