@@ -68,6 +68,9 @@ public function testAddTaggedTypes()
68
68
), $ extDefinition ->getArgument (1 ));
69
69
}
70
70
71
+ /**
72
+ * @group legacy
73
+ */
71
74
public function testUseCustomAliasIfSet ()
72
75
{
73
76
$ container = new ContainerBuilder ();
@@ -116,11 +119,11 @@ public function testAddTaggedTypeExtensions()
116
119
));
117
120
118
121
$ definition1 = new Definition ('stdClass ' );
119
- $ definition1 ->addTag ('form.type_extension ' , array ('alias ' => 'type1 ' ));
122
+ $ definition1 ->addTag ('form.type_extension ' , array ('extended_type ' => 'type1 ' ));
120
123
$ definition2 = new Definition ('stdClass ' );
121
- $ definition2 ->addTag ('form.type_extension ' , array ('alias ' => 'type1 ' ));
124
+ $ definition2 ->addTag ('form.type_extension ' , array ('extended_type ' => 'type1 ' ));
122
125
$ definition3 = new Definition ('stdClass ' );
123
- $ definition3 ->addTag ('form.type_extension ' , array ('alias ' => 'type2 ' ));
126
+ $ definition3 ->addTag ('form.type_extension ' , array ('extended_type ' => 'type2 ' ));
124
127
125
128
$ container ->setDefinition ('form.extension ' , $ extDefinition );
126
129
$ container ->setDefinition ('my.type_extension1 ' , $ definition1 );
@@ -142,6 +145,45 @@ public function testAddTaggedTypeExtensions()
142
145
), $ extDefinition ->getArgument (2 ));
143
146
}
144
147
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
+
145
187
public function testAddTaggedGuessers ()
146
188
{
147
189
$ container = new ContainerBuilder ();
0 commit comments