diff --git a/src/Form/Type/RolesMatrixType.php b/src/Form/Type/RolesMatrixType.php index 4ed59b3d4..5581b2f14 100644 --- a/src/Form/Type/RolesMatrixType.php +++ b/src/Form/Type/RolesMatrixType.php @@ -35,6 +35,7 @@ public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'expanded' => true, + 'multiple' => true, 'choices' => function (Options $options, ?array $parentChoices): array { if (null !== $parentChoices && [] !== $parentChoices) { return []; diff --git a/tests/Form/Type/RolesMatrixTypeTest.php b/tests/Form/Type/RolesMatrixTypeTest.php index d9be3b4a0..a0eef4f2d 100755 --- a/tests/Form/Type/RolesMatrixTypeTest.php +++ b/tests/Form/Type/RolesMatrixTypeTest.php @@ -58,6 +58,9 @@ public function testGetDefaultOptions(): void $choices = $options['choices']; static::assertCount(2, $choices); static::assertNotContains(UserInterface::ROLE_DEFAULT, $choices); + static::assertTrue($options['expanded']); + static::assertTrue($options['multiple']); + } public function testDifferentExcludedRoles(): void