Skip to content

Commit 5b2dd3e

Browse files
sverigerdbu
authored andcommitted
Fix use label as key in type choice array (#431)
1 parent ed21276 commit 5b2dd3e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Form/Type/RouteTypeType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function configureOptions(OptionsResolver $resolver)
2828
{
2929
$choices = [];
3030
foreach ($this->routeTypes as $routeType) {
31-
$choices[$routeType] = 'route_type.'.$routeType;
31+
$choices['route_type.'.$routeType] = $routeType;
3232
}
3333

3434
$resolver->setDefaults([

tests/Unit/Form/Type/RouteTypeTypeTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ public function testDefaultsSet()
4848
->method('setDefaults')
4949
->with([
5050
'choices' => [
51-
'foobar' => 'route_type.foobar',
52-
'barfoo' => 'route_type.barfoo',
51+
'route_type.foobar' => 'foobar',
52+
'route_type.barfoo' => 'barfoo',
5353
],
5454
'translation_domain' => 'CmfRoutingBundle',
5555
]);

0 commit comments

Comments
 (0)