@@ -30,14 +30,6 @@ class ChoiceTypeTest extends \Symfony\Component\Form\Test\TypeTestCase
30
30
'n/a ' => '' ,
31
31
);
32
32
33
- private $ numericChoicesFlipped = array (
34
- 0 => 'Bernhard ' ,
35
- 1 => 'Fabien ' ,
36
- 2 => 'Kris ' ,
37
- 3 => 'Jon ' ,
38
- 4 => 'Roman ' ,
39
- );
40
-
41
33
private $ objectChoices ;
42
34
43
35
protected $ groupedChoices = array (
@@ -110,9 +102,8 @@ public function testExpandedChoicesOptionsTurnIntoChildren()
110
102
111
103
public function testChoiceListWithScalarValues ()
112
104
{
113
- $ view = $ this ->factory ->create ('choice ' , null , array (
105
+ $ view = $ this ->factory ->create ('Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , null , array (
114
106
'choices ' => $ this ->scalarChoices ,
115
- 'choices_as_values ' => true ,
116
107
))->createView ();
117
108
118
109
$ this ->assertSame ('1 ' , $ view ->vars ['choices ' ][0 ]->value );
@@ -125,19 +116,17 @@ public function testChoiceListWithScalarValues()
125
116
126
117
public function testChoiceListWithScalarValuesAndFalseAsPreSetData ()
127
118
{
128
- $ view = $ this ->factory ->create ('choice ' , false , array (
119
+ $ view = $ this ->factory ->create ('Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , false , array (
129
120
'choices ' => $ this ->scalarChoices ,
130
- 'choices_as_values ' => true ,
131
121
))->createView ();
132
122
133
123
$ this ->assertTrue ($ view ->vars ['is_selected ' ]($ view ->vars ['choices ' ][1 ]->value , $ view ->vars ['value ' ]), 'False value should be pre selected ' );
134
124
}
135
125
136
126
public function testExpandedChoiceListWithScalarValues ()
137
127
{
138
- $ view = $ this ->factory ->create ('choice ' , null , array (
128
+ $ view = $ this ->factory ->create ('Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , null , array (
139
129
'choices ' => $ this ->scalarChoices ,
140
- 'choices_as_values ' => true ,
141
130
'expanded ' => true ,
142
131
))->createView ();
143
132
@@ -148,9 +137,8 @@ public function testExpandedChoiceListWithScalarValues()
148
137
149
138
public function testExpandedChoiceListWithScalarValuesAndFalseAsPreSetData ()
150
139
{
151
- $ view = $ this ->factory ->create ('choice ' , false , array (
140
+ $ view = $ this ->factory ->create ('Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , false , array (
152
141
'choices ' => $ this ->scalarChoices ,
153
- 'choices_as_values ' => true ,
154
142
'expanded ' => true ,
155
143
))->createView ();
156
144
@@ -217,7 +205,7 @@ public function testPlaceholderNotPresentIfEmptyChoice()
217
205
218
206
public function testPlaceholderWithBooleanChoices ()
219
207
{
220
- $ form = $ this ->factory ->create ('choice ' , null , array (
208
+ $ form = $ this ->factory ->create ('Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , null , array (
221
209
'multiple ' => false ,
222
210
'expanded ' => false ,
223
211
'required ' => false ,
@@ -226,7 +214,6 @@ public function testPlaceholderWithBooleanChoices()
226
214
'No ' => false ,
227
215
),
228
216
'placeholder ' => 'Select an option ' ,
229
- 'choices_as_values ' => true ,
230
217
));
231
218
232
219
$ view = $ form ->createView ();
@@ -239,7 +226,7 @@ public function testPlaceholderWithBooleanChoices()
239
226
240
227
public function testPlaceholderWithBooleanChoicesWithFalseAsPreSetData ()
241
228
{
242
- $ form = $ this ->factory ->create ('choice ' , false , array (
229
+ $ form = $ this ->factory ->create ('Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , false , array (
243
230
'multiple ' => false ,
244
231
'expanded ' => false ,
245
232
'required ' => false ,
@@ -248,7 +235,6 @@ public function testPlaceholderWithBooleanChoicesWithFalseAsPreSetData()
248
235
'No ' => false ,
249
236
),
250
237
'placeholder ' => 'Select an option ' ,
251
- 'choices_as_values ' => true ,
252
238
));
253
239
254
240
$ view = $ form ->createView ();
@@ -261,7 +247,7 @@ public function testPlaceholderWithBooleanChoicesWithFalseAsPreSetData()
261
247
262
248
public function testPlaceholderWithExpandedBooleanChoices ()
263
249
{
264
- $ form = $ this ->factory ->create ('choice ' , null , array (
250
+ $ form = $ this ->factory ->create ('Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , null , array (
265
251
'multiple ' => false ,
266
252
'expanded ' => true ,
267
253
'required ' => false ,
@@ -270,7 +256,6 @@ public function testPlaceholderWithExpandedBooleanChoices()
270
256
'No ' => false ,
271
257
),
272
258
'placeholder ' => 'Select an option ' ,
273
- 'choices_as_values ' => true ,
274
259
));
275
260
276
261
$ this ->assertTrue (isset ($ form ['placeholder ' ]), 'Placeholder should be set ' );
@@ -286,7 +271,7 @@ public function testPlaceholderWithExpandedBooleanChoices()
286
271
287
272
public function testPlaceholderWithExpandedBooleanChoicesAndWithFalseAsPreSetData ()
288
273
{
289
- $ form = $ this ->factory ->create ('choice ' , false , array (
274
+ $ form = $ this ->factory ->create ('Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , false , array (
290
275
'multiple ' => false ,
291
276
'expanded ' => true ,
292
277
'required ' => false ,
@@ -295,7 +280,6 @@ public function testPlaceholderWithExpandedBooleanChoicesAndWithFalseAsPreSetDat
295
280
'No ' => false ,
296
281
),
297
282
'placeholder ' => 'Select an option ' ,
298
- 'choices_as_values ' => true ,
299
283
));
300
284
301
285
$ this ->assertTrue (isset ($ form ['placeholder ' ]), 'Placeholder should be set ' );
0 commit comments