class AllowedScaffoldPackagesValidatorTest
@covers \Drupal\package_manager\Validator\AllowedScaffoldPackagesValidator @group package_manager @internal
Hierarchy
- class \Drupal\KernelTests\KernelTestBase extends \PHPUnit\Framework\TestCase implements \Drupal\Core\DependencyInjection\ServiceProviderInterface uses \Drupal\KernelTests\AssertContentTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\ExtensionListTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\PhpUnitCompatibilityTrait, \Prophecy\PhpUnit\ProphecyTrait, \Drupal\TestTools\Extension\DeprecationBridge\ExpectDeprecationTrait
- class \Drupal\Tests\package_manager\Kernel\PackageManagerKernelTestBase extends \Drupal\KernelTests\KernelTestBase uses \Drupal\Tests\package_manager\Traits\AssertPreconditionsTrait, \Drupal\Tests\package_manager\Traits\ComposerStagerTestTrait, \Drupal\Tests\package_manager\Traits\FixtureManipulatorTrait, \Drupal\Tests\package_manager\Traits\FixtureUtilityTrait, \Drupal\package_manager\StatusCheckTrait, \Drupal\Tests\package_manager\Traits\ValidationTestTrait
- class \Drupal\Tests\package_manager\Kernel\AllowedScaffoldPackagesValidatorTest extends \Drupal\Tests\package_manager\Kernel\PackageManagerKernelTestBase
- class \Drupal\Tests\package_manager\Kernel\PackageManagerKernelTestBase extends \Drupal\KernelTests\KernelTestBase uses \Drupal\Tests\package_manager\Traits\AssertPreconditionsTrait, \Drupal\Tests\package_manager\Traits\ComposerStagerTestTrait, \Drupal\Tests\package_manager\Traits\FixtureManipulatorTrait, \Drupal\Tests\package_manager\Traits\FixtureUtilityTrait, \Drupal\package_manager\StatusCheckTrait, \Drupal\Tests\package_manager\Traits\ValidationTestTrait
Expanded class hierarchy of AllowedScaffoldPackagesValidatorTest
File
-
core/
modules/ package_manager/ tests/ src/ Kernel/ AllowedScaffoldPackagesValidatorTest.php, line 17
Namespace
Drupal\Tests\package_manager\KernelView source
class AllowedScaffoldPackagesValidatorTest extends PackageManagerKernelTestBase {
/**
* Tests that the allowed-packages setting is validated during pre-create.
*/
public function testPreCreate() : void {
(new ActiveFixtureManipulator())->addConfig([
'extra.drupal-scaffold.allowed-packages' => [
"drupal/dummy_scaffolding",
"drupal/dummy_scaffolding_2",
],
])
->commitChanges();
$result = ValidationResult::createError([
t("drupal/dummy_scaffolding"),
t("drupal/dummy_scaffolding_2"),
], 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->assertStatusCheckResults([
$result,
]);
$this->assertResults([
$result,
], PreCreateEvent::class);
}
/**
* Tests that the allowed-packages setting is validated during pre-apply.
*/
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.