function PhpTufValidatorTest::testInvalidConfigurationInProjectRoot

Tests errors caused by invalid plugin configuration in the project root.

@dataProvider providerInvalidConfiguration

Parameters

array $config: The Composer configuration to set.

\Drupal\Core\StringTranslation\TranslatableMarkup[] $expected_messages: The expected error messages.

File

core/modules/package_manager/tests/src/Kernel/PhpTufValidatorTest.php, line 192

Class

PhpTufValidatorTest
@coversDefaultClass \Drupal\package_manager\Validator\PhpTufValidator @group package_manager @internal

Namespace

Drupal\Tests\package_manager\Kernel

Code

public function testInvalidConfigurationInProjectRoot(array $config, array $expected_messages) : void {
    (new ActiveFixtureManipulator())->addConfig($config)
        ->commitChanges();
    $result = ValidationResult::createError($expected_messages, t('The active directory is not protected by PHP-TUF, which is required to use Package Manager securely.'));
    $this->assertStatusCheckResults([
        $result,
    ]);
    $this->assertResults([
        $result,
    ], PreCreateEvent::class);
}

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