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 198

Class

PhpTufValidatorTest
@coversDefaultClass \Drupal\package_manager\Validator\PhpTufValidator[[api-linebreak]] @group package_manager @group #slow @internal

Namespace

Drupal\Tests\package_manager\Kernel

Code

public function testInvalidConfigurationInProjectRoot(array $config, array $expected_messages) : void {
  (new ActiveFixtureManipulator())->addConfig($config)
    ->commitChanges()
    ->updateLock();
  $result = ValidationResult::createError($expected_messages, $this->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.