function ComposerPluginsValidatorTest::testValidationDuringPreApply

Tests composer plugins are validated during pre-apply.

@dataProvider providerSimpleValidCases @dataProvider providerSimpleInvalidCases @dataProvider providerComplexInvalidCases

1 call to ComposerPluginsValidatorTest::testValidationDuringPreApply()
ComposerPluginsValidatorTest::testValidationAfterTrustingDuringPreApply in core/modules/package_manager/tests/src/Kernel/ComposerPluginsValidatorTest.php
Tests additional composer plugins can be trusted during pre-apply.

File

core/modules/package_manager/tests/src/Kernel/ComposerPluginsValidatorTest.php, line 86

Class

ComposerPluginsValidatorTest
@covers \Drupal\package_manager\Validator\ComposerPluginsValidator @group package_manager @internal

Namespace

Drupal\Tests\package_manager\Kernel

Code

public function testValidationDuringPreApply(array $composer_config_to_add, array $packages_to_add, array $expected_results) : void {
    $stage_manipulator = $this->getStageFixtureManipulator();
    if ($composer_config_to_add) {
        $stage_manipulator->addConfig($composer_config_to_add);
    }
    foreach ($packages_to_add as $package) {
        $stage_manipulator->addPackage($package);
    }
    // Ensure \Drupal\package_manager\Validator\SupportedReleaseValidator does
    // not complain.
    $release_fixture_folder = __DIR__ . '/../../fixtures/release-history';
    $this->setReleaseMetadata([
        'semver_test' => "{$release_fixture_folder}/semver_test.1.1.xml",
    ]);
    $this->assertResults($expected_results, PreApplyEvent::class);
}

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