diff --git a/package_manager/tests/src/Kernel/ComposerPluginsValidatorTest.php b/package_manager/tests/src/Kernel/ComposerPluginsValidatorTest.php index 8492a8d407a67d7999653c50c2464fda4d33ee9e..e4a791d5b65c868f0b45372618f7f3fab7126e6c 100644 --- a/package_manager/tests/src/Kernel/ComposerPluginsValidatorTest.php +++ b/package_manager/tests/src/Kernel/ComposerPluginsValidatorTest.php @@ -5,6 +5,7 @@ declare(strict_types = 1); namespace Drupal\Tests\package_manager\Kernel; use Drupal\Component\Utility\NestedArray; +use Drupal\Core\Config\Schema\SchemaIncompleteException; use Drupal\Core\StringTranslation\TranslatableMarkup; use Drupal\fixture_manipulator\ActiveFixtureManipulator; use Drupal\package_manager\Event\PreApplyEvent; @@ -154,7 +155,7 @@ class ComposerPluginsValidatorTest extends PackageManagerKernelTestBase { */ public function testPackageNameRegex(string $package_name, bool $exception_expected) { if ($exception_expected) { - $this->expectException(\Exception::class); + $this->expectException(SchemaIncompleteException::class); } $this->config('package_manager.settings') ->set('additional_trusted_composer_plugins', [$package_name]) @@ -170,7 +171,10 @@ class ComposerPluginsValidatorTest extends PackageManagerKernelTestBase { public function providerPackageNameRegex() { return [ 'good name' => ['org/package', FALSE], - 'bad name' => ['you need a / but also you probably can\'t have ****************', TRUE], + 'space in org' => ['org /package', TRUE], + 'space in package' => ['org/ package', TRUE], + 'no slash' => ['org-package', TRUE], + 'other character' => ['org/package*', TRUE], ]; }