Skip to content

Commit

Permalink
Use multiple options by default for RolesMatrixType form
Browse files Browse the repository at this point in the history
  • Loading branch information
phansys committed Sep 30, 2023
1 parent f97f681 commit 75c38e5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Form/Type/RolesMatrixType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 [];
Expand Down
3 changes: 3 additions & 0 deletions tests/Form/Type/RolesMatrixTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 75c38e5

Please sign in to comment.