function ComposerPluginsValidatorInsecureTest::testInsecureConfigurationFailsValidationPreApply
Tests `config.allow-plugins: true` fails validation during pre-apply.
File
-
core/
modules/ package_manager/ tests/ src/ Kernel/ ComposerPluginsValidatorInsecureTest.php, line 43
Class
- ComposerPluginsValidatorInsecureTest
- @covers \Drupal\package_manager\Validator\ComposerPluginsValidator @group package_manager @internal
Namespace
Drupal\Tests\package_manager\KernelCode
public function testInsecureConfigurationFailsValidationPreApply() : void {
$stage_manipulator = $this->getStageFixtureManipulator();
$stage_manipulator->addConfig([
'allow-plugins' => TRUE,
]);
$expected_results = [
ValidationResult::createError([
new TranslatableMarkup('All composer plugins are allowed because <code>config.allow-plugins</code> is configured to <code>true</code>. This is an unacceptable security risk.'),
]),
];
$this->assertResults($expected_results, PreApplyEvent::class);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.