@@ -68,6 +68,9 @@ public function testAddTaggedTypes()
6868 ), $ extDefinition ->getArgument (1 ));
6969 }
7070
71+ /**
72+ * @group legacy
73+ */
7174 public function testUseCustomAliasIfSet ()
7275 {
7376 $ container = new ContainerBuilder ();
@@ -116,11 +119,11 @@ public function testAddTaggedTypeExtensions()
116119 ));
117120
118121 $ definition1 = new Definition ('stdClass ' );
119- $ definition1 ->addTag ('form.type_extension ' , array ('alias ' => 'type1 ' ));
122+ $ definition1 ->addTag ('form.type_extension ' , array ('extended_type ' => 'type1 ' ));
120123 $ definition2 = new Definition ('stdClass ' );
121- $ definition2 ->addTag ('form.type_extension ' , array ('alias ' => 'type1 ' ));
124+ $ definition2 ->addTag ('form.type_extension ' , array ('extended_type ' => 'type1 ' ));
122125 $ definition3 = new Definition ('stdClass ' );
123- $ definition3 ->addTag ('form.type_extension ' , array ('alias ' => 'type2 ' ));
126+ $ definition3 ->addTag ('form.type_extension ' , array ('extended_type ' => 'type2 ' ));
124127
125128 $ container ->setDefinition ('form.extension ' , $ extDefinition );
126129 $ container ->setDefinition ('my.type_extension1 ' , $ definition1 );
@@ -142,6 +145,45 @@ public function testAddTaggedTypeExtensions()
142145 ), $ extDefinition ->getArgument (2 ));
143146 }
144147
148+ /**
149+ * @group legacy
150+ */
151+ public function testAliasOptionForTaggedTypeExtensions ()
152+ {
153+ $ container = new ContainerBuilder ();
154+ $ container ->addCompilerPass (new FormPass ());
155+
156+ $ extDefinition = new Definition ('Symfony\Component\Form\Extension\DependencyInjection\DependencyInjectionExtension ' );
157+ $ extDefinition ->setArguments (array (
158+ new Reference ('service_container ' ),
159+ array (),
160+ array (),
161+ array (),
162+ ));
163+
164+ $ definition1 = new Definition ('stdClass ' );
165+ $ definition1 ->addTag ('form.type_extension ' , array ('alias ' => 'type1 ' ));
166+ $ definition2 = new Definition ('stdClass ' );
167+ $ definition2 ->addTag ('form.type_extension ' , array ('alias ' => 'type2 ' ));
168+
169+ $ container ->setDefinition ('form.extension ' , $ extDefinition );
170+ $ container ->setDefinition ('my.type_extension1 ' , $ definition1 );
171+ $ container ->setDefinition ('my.type_extension2 ' , $ definition2 );
172+
173+ $ container ->compile ();
174+
175+ $ extDefinition = $ container ->getDefinition ('form.extension ' );
176+
177+ $ this ->assertSame (array (
178+ 'type1 ' => array (
179+ 'my.type_extension1 ' ,
180+ ),
181+ 'type2 ' => array (
182+ 'my.type_extension2 ' ,
183+ ),
184+ ), $ extDefinition ->getArgument (2 ));
185+ }
186+
145187 public function testAddTaggedGuessers ()
146188 {
147189 $ container = new ContainerBuilder ();
0 commit comments