function AllowedScaffoldPackagesValidatorTest::testPreApply

Tests that the allowed-packages setting is validated during pre-apply.

File

core/modules/package_manager/tests/src/Kernel/AllowedScaffoldPackagesValidatorTest.php, line 44

Class

AllowedScaffoldPackagesValidatorTest
@covers \Drupal\package_manager\Validator\AllowedScaffoldPackagesValidator @group package_manager @internal

Namespace

Drupal\Tests\package_manager\Kernel

Code

public function testPreApply() : void {
    $this->getStageFixtureManipulator()
        ->addConfig([
        'extra.drupal-scaffold.allowed-packages' => [
            "drupal/dummy_scaffolding",
        ],
    ]);
    $result = ValidationResult::createError([
        t("drupal/dummy_scaffolding"),
    ], t('Any packages other than the implicitly allowed packages are not allowed to scaffold files. See <a href="https://www.drupal.org/docs/develop/using-composer/using-drupals-composer-scaffold">the scaffold documentation</a> for more information.'));
    $this->assertResults([
        $result,
    ], PreApplyEvent::class);
}

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