Skip to content

Commit

Permalink
Use multiple options by default for RolesMatrixType form (#1661)
Browse files Browse the repository at this point in the history
  • Loading branch information
phansys authored Oct 1, 2023
1 parent f97f681 commit 4314383
Show file tree
Hide file tree
Showing 2 changed files with 3 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
2 changes: 2 additions & 0 deletions tests/Form/Type/RolesMatrixTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ 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 4314383

Please sign in to comment.