@@ -212,7 +212,8 @@ public function testCheckboxWithValue()
212
212
public function testSingleChoice ()
213
213
{
214
214
$ form = $ this ->factory ->createNamed ('name ' , 'Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , '&a ' , array (
215
- 'choices ' => array ('&a ' => 'Choice&A ' , '&b ' => 'Choice&B ' ),
215
+ 'choices ' => array ('Choice&A ' => '&a ' , 'Choice&B ' => '&b ' ),
216
+ 'choices_as_values ' => true ,
216
217
'multiple ' => false ,
217
218
'expanded ' => false ,
218
219
));
@@ -234,7 +235,8 @@ public function testSingleChoice()
234
235
public function testSingleChoiceWithoutTranslation ()
235
236
{
236
237
$ form = $ this ->factory ->createNamed ('name ' , 'Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , '&a ' , array (
237
- 'choices ' => array ('&a ' => 'Choice&A ' , '&b ' => 'Choice&B ' ),
238
+ 'choices ' => array ('Choice&A ' => '&a ' , 'Choice&B ' => '&b ' ),
239
+ 'choices_as_values ' => true ,
238
240
'multiple ' => false ,
239
241
'expanded ' => false ,
240
242
'choice_translation_domain ' => false ,
@@ -257,7 +259,8 @@ public function testSingleChoiceWithoutTranslation()
257
259
public function testSingleChoiceWithPlaceholderWithoutTranslation ()
258
260
{
259
261
$ form = $ this ->factory ->createNamed ('name ' , 'Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , '&a ' , array (
260
- 'choices ' => array ('&a ' => 'Choice&A ' , '&b ' => 'Choice&B ' ),
262
+ 'choices ' => array ('Choice&A ' => '&a ' , 'Choice&B ' => '&b ' ),
263
+ 'choices_as_values ' => true ,
261
264
'multiple ' => false ,
262
265
'expanded ' => false ,
263
266
'required ' => false ,
@@ -283,7 +286,8 @@ public function testSingleChoiceWithPlaceholderWithoutTranslation()
283
286
public function testSingleChoiceAttributes ()
284
287
{
285
288
$ form = $ this ->factory ->createNamed ('name ' , 'Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , '&a ' , array (
286
- 'choices ' => array ('&a ' => 'Choice&A ' , '&b ' => 'Choice&B ' ),
289
+ 'choices ' => array ('Choice&A ' => '&a ' , 'Choice&B ' => '&b ' ),
290
+ 'choices_as_values ' => true ,
287
291
'choice_attr ' => array ('Choice&B ' => array ('class ' => 'foo&bar ' )),
288
292
'multiple ' => false ,
289
293
'expanded ' => false ,
@@ -308,7 +312,8 @@ public function testSingleChoiceAttributes()
308
312
public function testSingleChoiceWithPreferred ()
309
313
{
310
314
$ form = $ this ->factory ->createNamed ('name ' , 'Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , '&a ' , array (
311
- 'choices ' => array ('&a ' => 'Choice&A ' , '&b ' => 'Choice&B ' ),
315
+ 'choices ' => array ('Choice&A ' => '&a ' , 'Choice&B ' => '&b ' ),
316
+ 'choices_as_values ' => true ,
312
317
'preferred_choices ' => array ('&b ' ),
313
318
'multiple ' => false ,
314
319
'expanded ' => false ,
@@ -332,7 +337,8 @@ public function testSingleChoiceWithPreferred()
332
337
public function testSingleChoiceWithPreferredAndNoSeparator ()
333
338
{
334
339
$ form = $ this ->factory ->createNamed ('name ' , 'Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , '&a ' , array (
335
- 'choices ' => array ('&a ' => 'Choice&A ' , '&b ' => 'Choice&B ' ),
340
+ 'choices ' => array ('Choice&A ' => '&a ' , 'Choice&B ' => '&b ' ),
341
+ 'choices_as_values ' => true ,
336
342
'preferred_choices ' => array ('&b ' ),
337
343
'multiple ' => false ,
338
344
'expanded ' => false ,
@@ -355,7 +361,8 @@ public function testSingleChoiceWithPreferredAndNoSeparator()
355
361
public function testSingleChoiceWithPreferredAndBlankSeparator ()
356
362
{
357
363
$ form = $ this ->factory ->createNamed ('name ' , 'Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , '&a ' , array (
358
- 'choices ' => array ('&a ' => 'Choice&A ' , '&b ' => 'Choice&B ' ),
364
+ 'choices ' => array ('Choice&A ' => '&a ' , 'Choice&B ' => '&b ' ),
365
+ 'choices_as_values ' => true ,
359
366
'preferred_choices ' => array ('&b ' ),
360
367
'multiple ' => false ,
361
368
'expanded ' => false ,
@@ -379,7 +386,8 @@ public function testSingleChoiceWithPreferredAndBlankSeparator()
379
386
public function testChoiceWithOnlyPreferred ()
380
387
{
381
388
$ form = $ this ->factory ->createNamed ('name ' , 'Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , '&a ' , array (
382
- 'choices ' => array ('&a ' => 'Choice&A ' , '&b ' => 'Choice&B ' ),
389
+ 'choices ' => array ('Choice&A ' => '&a ' , 'Choice&B ' => '&b ' ),
390
+ 'choices_as_values ' => true ,
383
391
'preferred_choices ' => array ('&a ' , '&b ' ),
384
392
'multiple ' => false ,
385
393
'expanded ' => false ,
@@ -396,7 +404,8 @@ public function testChoiceWithOnlyPreferred()
396
404
public function testSingleChoiceNonRequired ()
397
405
{
398
406
$ form = $ this ->factory ->createNamed ('name ' , 'Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , '&a ' , array (
399
- 'choices ' => array ('&a ' => 'Choice&A ' , '&b ' => 'Choice&B ' ),
407
+ 'choices ' => array ('Choice&A ' => '&a ' , 'Choice&B ' => '&b ' ),
408
+ 'choices_as_values ' => true ,
400
409
'required ' => false ,
401
410
'multiple ' => false ,
402
411
'expanded ' => false ,
@@ -420,7 +429,8 @@ public function testSingleChoiceNonRequired()
420
429
public function testSingleChoiceNonRequiredNoneSelected ()
421
430
{
422
431
$ form = $ this ->factory ->createNamed ('name ' , 'Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , null , array (
423
- 'choices ' => array ('&a ' => 'Choice&A ' , '&b ' => 'Choice&B ' ),
432
+ 'choices ' => array ('Choice&A ' => '&a ' , 'Choice&B ' => '&b ' ),
433
+ 'choices_as_values ' => true ,
424
434
'required ' => false ,
425
435
'multiple ' => false ,
426
436
'expanded ' => false ,
@@ -444,7 +454,8 @@ public function testSingleChoiceNonRequiredNoneSelected()
444
454
public function testSingleChoiceNonRequiredWithPlaceholder ()
445
455
{
446
456
$ form = $ this ->factory ->createNamed ('name ' , 'Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , '&a ' , array (
447
- 'choices ' => array ('&a ' => 'Choice&A ' , '&b ' => 'Choice&B ' ),
457
+ 'choices ' => array ('Choice&A ' => '&a ' , 'Choice&B ' => '&b ' ),
458
+ 'choices_as_values ' => true ,
448
459
'multiple ' => false ,
449
460
'expanded ' => false ,
450
461
'required ' => false ,
@@ -469,7 +480,8 @@ public function testSingleChoiceNonRequiredWithPlaceholder()
469
480
public function testSingleChoiceRequiredWithPlaceholder ()
470
481
{
471
482
$ form = $ this ->factory ->createNamed ('name ' , 'Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , '&a ' , array (
472
- 'choices ' => array ('&a ' => 'Choice&A ' , '&b ' => 'Choice&B ' ),
483
+ 'choices ' => array ('Choice&A ' => '&a ' , 'Choice&B ' => '&b ' ),
484
+ 'choices_as_values ' => true ,
473
485
'required ' => true ,
474
486
'multiple ' => false ,
475
487
'expanded ' => false ,
@@ -494,7 +506,8 @@ public function testSingleChoiceRequiredWithPlaceholder()
494
506
public function testSingleChoiceRequiredWithPlaceholderViaView ()
495
507
{
496
508
$ form = $ this ->factory ->createNamed ('name ' , 'Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , '&a ' , array (
497
- 'choices ' => array ('&a ' => 'Choice&A ' , '&b ' => 'Choice&B ' ),
509
+ 'choices ' => array ('Choice&A ' => '&a ' , 'Choice&B ' => '&b ' ),
510
+ 'choices_as_values ' => true ,
498
511
'required ' => true ,
499
512
'multiple ' => false ,
500
513
'expanded ' => false ,
@@ -519,9 +532,10 @@ public function testSingleChoiceGrouped()
519
532
{
520
533
$ form = $ this ->factory ->createNamed ('name ' , 'Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , '&a ' , array (
521
534
'choices ' => array (
522
- 'Group&1 ' => array ('&a ' => 'Choice&A ' , '&b ' => 'Choice&B ' ),
523
- 'Group&2 ' => array ('&c ' => 'Choice&C ' ),
535
+ 'Group&1 ' => array ('Choice&A ' => '&a ' , 'Choice&B ' => '&b ' ),
536
+ 'Group&2 ' => array ('Choice&C ' => '&c ' ),
524
537
),
538
+ 'choices_as_values ' => true ,
525
539
'multiple ' => false ,
526
540
'expanded ' => false ,
527
541
));
@@ -549,7 +563,8 @@ public function testSingleChoiceGrouped()
549
563
public function testMultipleChoice ()
550
564
{
551
565
$ form = $ this ->factory ->createNamed ('name ' , 'Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , array ('&a ' ), array (
552
- 'choices ' => array ('&a ' => 'Choice&A ' , '&b ' => 'Choice&B ' ),
566
+ 'choices ' => array ('Choice&A ' => '&a ' , 'Choice&B ' => '&b ' ),
567
+ 'choices_as_values ' => true ,
553
568
'required ' => true ,
554
569
'multiple ' => true ,
555
570
'expanded ' => false ,
@@ -573,7 +588,8 @@ public function testMultipleChoice()
573
588
public function testMultipleChoiceAttributes ()
574
589
{
575
590
$ form = $ this ->factory ->createNamed ('name ' , 'Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , array ('&a ' ), array (
576
- 'choices ' => array ('&a ' => 'Choice&A ' , '&b ' => 'Choice&B ' ),
591
+ 'choices ' => array ('Choice&A ' => '&a ' , 'Choice&B ' => '&b ' ),
592
+ 'choices_as_values ' => true ,
577
593
'choice_attr ' => array ('Choice&B ' => array ('class ' => 'foo&bar ' )),
578
594
'required ' => true ,
579
595
'multiple ' => true ,
@@ -600,7 +616,8 @@ public function testMultipleChoiceAttributes()
600
616
public function testMultipleChoiceSkipsPlaceholder ()
601
617
{
602
618
$ form = $ this ->factory ->createNamed ('name ' , 'Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , array ('&a ' ), array (
603
- 'choices ' => array ('&a ' => 'Choice&A ' , '&b ' => 'Choice&B ' ),
619
+ 'choices ' => array ('Choice&A ' => '&a ' , 'Choice&B ' => '&b ' ),
620
+ 'choices_as_values ' => true ,
604
621
'multiple ' => true ,
605
622
'expanded ' => false ,
606
623
'placeholder ' => 'Test&Me ' ,
@@ -623,7 +640,8 @@ public function testMultipleChoiceSkipsPlaceholder()
623
640
public function testMultipleChoiceNonRequired ()
624
641
{
625
642
$ form = $ this ->factory ->createNamed ('name ' , 'Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , array ('&a ' ), array (
626
- 'choices ' => array ('&a ' => 'Choice&A ' , '&b ' => 'Choice&B ' ),
643
+ 'choices ' => array ('Choice&A ' => '&a ' , 'Choice&B ' => '&b ' ),
644
+ 'choices_as_values ' => true ,
627
645
'required ' => false ,
628
646
'multiple ' => true ,
629
647
'expanded ' => false ,
@@ -646,7 +664,8 @@ public function testMultipleChoiceNonRequired()
646
664
public function testSingleChoiceExpanded ()
647
665
{
648
666
$ form = $ this ->factory ->createNamed ('name ' , 'Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , '&a ' , array (
649
- 'choices ' => array ('&a ' => 'Choice&A ' , '&b ' => 'Choice&B ' ),
667
+ 'choices ' => array ('Choice&A ' => '&a ' , 'Choice&B ' => '&b ' ),
668
+ 'choices_as_values ' => true ,
650
669
'multiple ' => false ,
651
670
'expanded ' => true ,
652
671
));
@@ -681,7 +700,8 @@ public function testSingleChoiceExpanded()
681
700
public function testSingleChoiceExpandedWithoutTranslation ()
682
701
{
683
702
$ form = $ this ->factory ->createNamed ('name ' , 'Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , '&a ' , array (
684
- 'choices ' => array ('&a ' => 'Choice&A ' , '&b ' => 'Choice&B ' ),
703
+ 'choices ' => array ('Choice&A ' => '&a ' , 'Choice&B ' => '&b ' ),
704
+ 'choices_as_values ' => true ,
685
705
'multiple ' => false ,
686
706
'expanded ' => true ,
687
707
'choice_translation_domain ' => false ,
@@ -717,7 +737,8 @@ public function testSingleChoiceExpandedWithoutTranslation()
717
737
public function testSingleChoiceExpandedAttributes ()
718
738
{
719
739
$ form = $ this ->factory ->createNamed ('name ' , 'Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , '&a ' , array (
720
- 'choices ' => array ('&a ' => 'Choice&A ' , '&b ' => 'Choice&B ' ),
740
+ 'choices ' => array ('Choice&A ' => '&a ' , 'Choice&B ' => '&b ' ),
741
+ 'choices_as_values ' => true ,
721
742
'choice_attr ' => array ('Choice&B ' => array ('class ' => 'foo&bar ' )),
722
743
'multiple ' => false ,
723
744
'expanded ' => true ,
@@ -755,7 +776,8 @@ public function testSingleChoiceExpandedAttributes()
755
776
public function testSingleChoiceExpandedWithPlaceholder ()
756
777
{
757
778
$ form = $ this ->factory ->createNamed ('name ' , 'Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , '&a ' , array (
758
- 'choices ' => array ('&a ' => 'Choice&A ' , '&b ' => 'Choice&B ' ),
779
+ 'choices ' => array ('Choice&A ' => '&a ' , 'Choice&B ' => '&b ' ),
780
+ 'choices_as_values ' => true ,
759
781
'multiple ' => false ,
760
782
'expanded ' => true ,
761
783
'placeholder ' => 'Test&Me ' ,
@@ -800,7 +822,8 @@ public function testSingleChoiceExpandedWithPlaceholder()
800
822
public function testSingleChoiceExpandedWithPlaceholderWithoutTranslation ()
801
823
{
802
824
$ form = $ this ->factory ->createNamed ('name ' , 'Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , '&a ' , array (
803
- 'choices ' => array ('&a ' => 'Choice&A ' , '&b ' => 'Choice&B ' ),
825
+ 'choices ' => array ('Choice&A ' => '&a ' , 'Choice&B ' => '&b ' ),
826
+ 'choices_as_values ' => true ,
804
827
'multiple ' => false ,
805
828
'expanded ' => true ,
806
829
'translation_domain ' => false ,
@@ -846,7 +869,8 @@ public function testSingleChoiceExpandedWithPlaceholderWithoutTranslation()
846
869
public function testSingleChoiceExpandedWithBooleanValue ()
847
870
{
848
871
$ form = $ this ->factory ->createNamed ('name ' , 'Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , true , array (
849
- 'choices ' => array ('1 ' => 'Choice&A ' , '0 ' => 'Choice&B ' ),
872
+ 'choices ' => array ('Choice&A ' => '1 ' , 'Choice&B ' => '0 ' ),
873
+ 'choices_as_values ' => true ,
850
874
'multiple ' => false ,
851
875
'expanded ' => true ,
852
876
));
@@ -881,7 +905,8 @@ public function testSingleChoiceExpandedWithBooleanValue()
881
905
public function testMultipleChoiceExpanded ()
882
906
{
883
907
$ form = $ this ->factory ->createNamed ('name ' , 'Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , array ('&a ' , '&c ' ), array (
884
- 'choices ' => array ('&a ' => 'Choice&A ' , '&b ' => 'Choice&B ' , '&c ' => 'Choice&C ' ),
908
+ 'choices ' => array ('Choice&A ' => '&a ' , 'Choice&B ' => '&b ' , 'Choice&C ' => '&c ' ),
909
+ 'choices_as_values ' => true ,
885
910
'multiple ' => true ,
886
911
'expanded ' => true ,
887
912
'required ' => true ,
@@ -926,7 +951,8 @@ public function testMultipleChoiceExpanded()
926
951
public function testMultipleChoiceExpandedWithoutTranslation ()
927
952
{
928
953
$ form = $ this ->factory ->createNamed ('name ' , 'Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , array ('&a ' , '&c ' ), array (
929
- 'choices ' => array ('&a ' => 'Choice&A ' , '&b ' => 'Choice&B ' , '&c ' => 'Choice&C ' ),
954
+ 'choices ' => array ('Choice&A ' => '&a ' , 'Choice&B ' => '&b ' , 'Choice&C ' => '&c ' ),
955
+ 'choices_as_values ' => true ,
930
956
'multiple ' => true ,
931
957
'expanded ' => true ,
932
958
'required ' => true ,
@@ -972,7 +998,8 @@ public function testMultipleChoiceExpandedWithoutTranslation()
972
998
public function testMultipleChoiceExpandedAttributes ()
973
999
{
974
1000
$ form = $ this ->factory ->createNamed ('name ' , 'Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , array ('&a ' , '&c ' ), array (
975
- 'choices ' => array ('&a ' => 'Choice&A ' , '&b ' => 'Choice&B ' , '&c ' => 'Choice&C ' ),
1001
+ 'choices ' => array ('Choice&A ' => '&a ' , 'Choice&B ' => '&b ' , 'Choice&C ' => '&c ' ),
1002
+ 'choices_as_values ' => true ,
976
1003
'choice_attr ' => array ('Choice&B ' => array ('class ' => 'foo&bar ' )),
977
1004
'multiple ' => true ,
978
1005
'expanded ' => true ,
0 commit comments