@@ -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 ,
@@ -306,7 +310,8 @@ public function testSingleChoiceAttributes()
306
310
public function testSingleChoiceWithPreferred ()
307
311
{
308
312
$ form = $ this ->factory ->createNamed ('name ' , 'Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , '&a ' , array (
309
- 'choices ' => array ('&a ' => 'Choice&A ' , '&b ' => 'Choice&B ' ),
313
+ 'choices ' => array ('Choice&A ' => '&a ' , 'Choice&B ' => '&b ' ),
314
+ 'choices_as_values ' => true ,
310
315
'preferred_choices ' => array ('&b ' ),
311
316
'multiple ' => false ,
312
317
'expanded ' => false ,
@@ -330,7 +335,8 @@ public function testSingleChoiceWithPreferred()
330
335
public function testSingleChoiceWithPreferredAndNoSeparator ()
331
336
{
332
337
$ form = $ this ->factory ->createNamed ('name ' , 'Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , '&a ' , array (
333
- 'choices ' => array ('&a ' => 'Choice&A ' , '&b ' => 'Choice&B ' ),
338
+ 'choices ' => array ('Choice&A ' => '&a ' , 'Choice&B ' => '&b ' ),
339
+ 'choices_as_values ' => true ,
334
340
'preferred_choices ' => array ('&b ' ),
335
341
'multiple ' => false ,
336
342
'expanded ' => false ,
@@ -353,7 +359,8 @@ public function testSingleChoiceWithPreferredAndNoSeparator()
353
359
public function testSingleChoiceWithPreferredAndBlankSeparator ()
354
360
{
355
361
$ form = $ this ->factory ->createNamed ('name ' , 'Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , '&a ' , array (
356
- 'choices ' => array ('&a ' => 'Choice&A ' , '&b ' => 'Choice&B ' ),
362
+ 'choices ' => array ('Choice&A ' => '&a ' , 'Choice&B ' => '&b ' ),
363
+ 'choices_as_values ' => true ,
357
364
'preferred_choices ' => array ('&b ' ),
358
365
'multiple ' => false ,
359
366
'expanded ' => false ,
@@ -377,7 +384,8 @@ public function testSingleChoiceWithPreferredAndBlankSeparator()
377
384
public function testChoiceWithOnlyPreferred ()
378
385
{
379
386
$ form = $ this ->factory ->createNamed ('name ' , 'Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , '&a ' , array (
380
- 'choices ' => array ('&a ' => 'Choice&A ' , '&b ' => 'Choice&B ' ),
387
+ 'choices ' => array ('Choice&A ' => '&a ' , 'Choice&B ' => '&b ' ),
388
+ 'choices_as_values ' => true ,
381
389
'preferred_choices ' => array ('&a ' , '&b ' ),
382
390
'multiple ' => false ,
383
391
'expanded ' => false ,
@@ -394,7 +402,8 @@ public function testChoiceWithOnlyPreferred()
394
402
public function testSingleChoiceNonRequired ()
395
403
{
396
404
$ form = $ this ->factory ->createNamed ('name ' , 'Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , '&a ' , array (
397
- 'choices ' => array ('&a ' => 'Choice&A ' , '&b ' => 'Choice&B ' ),
405
+ 'choices ' => array ('Choice&A ' => '&a ' , 'Choice&B ' => '&b ' ),
406
+ 'choices_as_values ' => true ,
398
407
'required ' => false ,
399
408
'multiple ' => false ,
400
409
'expanded ' => false ,
@@ -418,7 +427,8 @@ public function testSingleChoiceNonRequired()
418
427
public function testSingleChoiceNonRequiredNoneSelected ()
419
428
{
420
429
$ form = $ this ->factory ->createNamed ('name ' , 'Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , null , array (
421
- 'choices ' => array ('&a ' => 'Choice&A ' , '&b ' => 'Choice&B ' ),
430
+ 'choices ' => array ('Choice&A ' => '&a ' , 'Choice&B ' => '&b ' ),
431
+ 'choices_as_values ' => true ,
422
432
'required ' => false ,
423
433
'multiple ' => false ,
424
434
'expanded ' => false ,
@@ -442,7 +452,8 @@ public function testSingleChoiceNonRequiredNoneSelected()
442
452
public function testSingleChoiceNonRequiredWithPlaceholder ()
443
453
{
444
454
$ form = $ this ->factory ->createNamed ('name ' , 'Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , '&a ' , array (
445
- 'choices ' => array ('&a ' => 'Choice&A ' , '&b ' => 'Choice&B ' ),
455
+ 'choices ' => array ('Choice&A ' => '&a ' , 'Choice&B ' => '&b ' ),
456
+ 'choices_as_values ' => true ,
446
457
'multiple ' => false ,
447
458
'expanded ' => false ,
448
459
'required ' => false ,
@@ -467,7 +478,8 @@ public function testSingleChoiceNonRequiredWithPlaceholder()
467
478
public function testSingleChoiceRequiredWithPlaceholder ()
468
479
{
469
480
$ form = $ this ->factory ->createNamed ('name ' , 'Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , '&a ' , array (
470
- 'choices ' => array ('&a ' => 'Choice&A ' , '&b ' => 'Choice&B ' ),
481
+ 'choices ' => array ('Choice&A ' => '&a ' , 'Choice&B ' => '&b ' ),
482
+ 'choices_as_values ' => true ,
471
483
'required ' => true ,
472
484
'multiple ' => false ,
473
485
'expanded ' => false ,
@@ -492,7 +504,8 @@ public function testSingleChoiceRequiredWithPlaceholder()
492
504
public function testSingleChoiceRequiredWithPlaceholderViaView ()
493
505
{
494
506
$ form = $ this ->factory ->createNamed ('name ' , 'Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , '&a ' , array (
495
- 'choices ' => array ('&a ' => 'Choice&A ' , '&b ' => 'Choice&B ' ),
507
+ 'choices ' => array ('Choice&A ' => '&a ' , 'Choice&B ' => '&b ' ),
508
+ 'choices_as_values ' => true ,
496
509
'required ' => true ,
497
510
'multiple ' => false ,
498
511
'expanded ' => false ,
@@ -517,9 +530,10 @@ public function testSingleChoiceGrouped()
517
530
{
518
531
$ form = $ this ->factory ->createNamed ('name ' , 'Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , '&a ' , array (
519
532
'choices ' => array (
520
- 'Group&1 ' => array ('&a ' => 'Choice&A ' , '&b ' => 'Choice&B ' ),
521
- 'Group&2 ' => array ('&c ' => 'Choice&C ' ),
533
+ 'Group&1 ' => array ('Choice&A ' => '&a ' , 'Choice&B ' => '&b ' ),
534
+ 'Group&2 ' => array ('Choice&C ' => '&c ' ),
522
535
),
536
+ 'choices_as_values ' => true ,
523
537
'multiple ' => false ,
524
538
'expanded ' => false ,
525
539
));
@@ -547,7 +561,8 @@ public function testSingleChoiceGrouped()
547
561
public function testMultipleChoice ()
548
562
{
549
563
$ form = $ this ->factory ->createNamed ('name ' , 'Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , array ('&a ' ), array (
550
- 'choices ' => array ('&a ' => 'Choice&A ' , '&b ' => 'Choice&B ' ),
564
+ 'choices ' => array ('Choice&A ' => '&a ' , 'Choice&B ' => '&b ' ),
565
+ 'choices_as_values ' => true ,
551
566
'required ' => true ,
552
567
'multiple ' => true ,
553
568
'expanded ' => false ,
@@ -571,7 +586,8 @@ public function testMultipleChoice()
571
586
public function testMultipleChoiceAttributes ()
572
587
{
573
588
$ form = $ this ->factory ->createNamed ('name ' , 'Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , array ('&a ' ), array (
574
- 'choices ' => array ('&a ' => 'Choice&A ' , '&b ' => 'Choice&B ' ),
589
+ 'choices ' => array ('Choice&A ' => '&a ' , 'Choice&B ' => '&b ' ),
590
+ 'choices_as_values ' => true ,
575
591
'choice_attr ' => array ('Choice&B ' => array ('class ' => 'foo&bar ' )),
576
592
'required ' => true ,
577
593
'multiple ' => true ,
@@ -596,7 +612,8 @@ public function testMultipleChoiceAttributes()
596
612
public function testMultipleChoiceSkipsPlaceholder ()
597
613
{
598
614
$ form = $ this ->factory ->createNamed ('name ' , 'Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , array ('&a ' ), array (
599
- 'choices ' => array ('&a ' => 'Choice&A ' , '&b ' => 'Choice&B ' ),
615
+ 'choices ' => array ('Choice&A ' => '&a ' , 'Choice&B ' => '&b ' ),
616
+ 'choices_as_values ' => true ,
600
617
'multiple ' => true ,
601
618
'expanded ' => false ,
602
619
'placeholder ' => 'Test&Me ' ,
@@ -619,7 +636,8 @@ public function testMultipleChoiceSkipsPlaceholder()
619
636
public function testMultipleChoiceNonRequired ()
620
637
{
621
638
$ form = $ this ->factory ->createNamed ('name ' , 'Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , array ('&a ' ), array (
622
- 'choices ' => array ('&a ' => 'Choice&A ' , '&b ' => 'Choice&B ' ),
639
+ 'choices ' => array ('Choice&A ' => '&a ' , 'Choice&B ' => '&b ' ),
640
+ 'choices_as_values ' => true ,
623
641
'required ' => false ,
624
642
'multiple ' => true ,
625
643
'expanded ' => false ,
@@ -642,7 +660,8 @@ public function testMultipleChoiceNonRequired()
642
660
public function testSingleChoiceExpanded ()
643
661
{
644
662
$ form = $ this ->factory ->createNamed ('name ' , 'Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , '&a ' , array (
645
- 'choices ' => array ('&a ' => 'Choice&A ' , '&b ' => 'Choice&B ' ),
663
+ 'choices ' => array ('Choice&A ' => '&a ' , 'Choice&B ' => '&b ' ),
664
+ 'choices_as_values ' => true ,
646
665
'multiple ' => false ,
647
666
'expanded ' => true ,
648
667
));
@@ -677,7 +696,8 @@ public function testSingleChoiceExpanded()
677
696
public function testSingleChoiceExpandedWithoutTranslation ()
678
697
{
679
698
$ form = $ this ->factory ->createNamed ('name ' , 'Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , '&a ' , array (
680
- 'choices ' => array ('&a ' => 'Choice&A ' , '&b ' => 'Choice&B ' ),
699
+ 'choices ' => array ('Choice&A ' => '&a ' , 'Choice&B ' => '&b ' ),
700
+ 'choices_as_values ' => true ,
681
701
'multiple ' => false ,
682
702
'expanded ' => true ,
683
703
'choice_translation_domain ' => false ,
@@ -713,7 +733,8 @@ public function testSingleChoiceExpandedWithoutTranslation()
713
733
public function testSingleChoiceExpandedAttributes ()
714
734
{
715
735
$ form = $ this ->factory ->createNamed ('name ' , 'Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , '&a ' , array (
716
- 'choices ' => array ('&a ' => 'Choice&A ' , '&b ' => 'Choice&B ' ),
736
+ 'choices ' => array ('Choice&A ' => '&a ' , 'Choice&B ' => '&b ' ),
737
+ 'choices_as_values ' => true ,
717
738
'choice_attr ' => array ('Choice&B ' => array ('class ' => 'foo&bar ' )),
718
739
'multiple ' => false ,
719
740
'expanded ' => true ,
@@ -749,7 +770,8 @@ public function testSingleChoiceExpandedAttributes()
749
770
public function testSingleChoiceExpandedWithPlaceholder ()
750
771
{
751
772
$ form = $ this ->factory ->createNamed ('name ' , 'Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , '&a ' , array (
752
- 'choices ' => array ('&a ' => 'Choice&A ' , '&b ' => 'Choice&B ' ),
773
+ 'choices ' => array ('Choice&A ' => '&a ' , 'Choice&B ' => '&b ' ),
774
+ 'choices_as_values ' => true ,
753
775
'multiple ' => false ,
754
776
'expanded ' => true ,
755
777
'placeholder ' => 'Test&Me ' ,
@@ -794,7 +816,8 @@ public function testSingleChoiceExpandedWithPlaceholder()
794
816
public function testSingleChoiceExpandedWithPlaceholderWithoutTranslation ()
795
817
{
796
818
$ form = $ this ->factory ->createNamed ('name ' , 'Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , '&a ' , array (
797
- 'choices ' => array ('&a ' => 'Choice&A ' , '&b ' => 'Choice&B ' ),
819
+ 'choices ' => array ('Choice&A ' => '&a ' , 'Choice&B ' => '&b ' ),
820
+ 'choices_as_values ' => true ,
798
821
'multiple ' => false ,
799
822
'expanded ' => true ,
800
823
'translation_domain ' => false ,
@@ -840,7 +863,8 @@ public function testSingleChoiceExpandedWithPlaceholderWithoutTranslation()
840
863
public function testSingleChoiceExpandedWithBooleanValue ()
841
864
{
842
865
$ form = $ this ->factory ->createNamed ('name ' , 'Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , true , array (
843
- 'choices ' => array ('1 ' => 'Choice&A ' , '0 ' => 'Choice&B ' ),
866
+ 'choices ' => array ('Choice&A ' => '1 ' , 'Choice&B ' => '0 ' ),
867
+ 'choices_as_values ' => true ,
844
868
'multiple ' => false ,
845
869
'expanded ' => true ,
846
870
));
@@ -875,7 +899,8 @@ public function testSingleChoiceExpandedWithBooleanValue()
875
899
public function testMultipleChoiceExpanded ()
876
900
{
877
901
$ form = $ this ->factory ->createNamed ('name ' , 'Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , array ('&a ' , '&c ' ), array (
878
- 'choices ' => array ('&a ' => 'Choice&A ' , '&b ' => 'Choice&B ' , '&c ' => 'Choice&C ' ),
902
+ 'choices ' => array ('Choice&A ' => '&a ' , 'Choice&B ' => '&b ' , 'Choice&C ' => '&c ' ),
903
+ 'choices_as_values ' => true ,
879
904
'multiple ' => true ,
880
905
'expanded ' => true ,
881
906
'required ' => true ,
@@ -920,7 +945,8 @@ public function testMultipleChoiceExpanded()
920
945
public function testMultipleChoiceExpandedWithoutTranslation ()
921
946
{
922
947
$ form = $ this ->factory ->createNamed ('name ' , 'Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , array ('&a ' , '&c ' ), array (
923
- 'choices ' => array ('&a ' => 'Choice&A ' , '&b ' => 'Choice&B ' , '&c ' => 'Choice&C ' ),
948
+ 'choices ' => array ('Choice&A ' => '&a ' , 'Choice&B ' => '&b ' , 'Choice&C ' => '&c ' ),
949
+ 'choices_as_values ' => true ,
924
950
'multiple ' => true ,
925
951
'expanded ' => true ,
926
952
'required ' => true ,
@@ -966,7 +992,8 @@ public function testMultipleChoiceExpandedWithoutTranslation()
966
992
public function testMultipleChoiceExpandedAttributes ()
967
993
{
968
994
$ form = $ this ->factory ->createNamed ('name ' , 'Symfony\Component\Form\Extension\Core\Type\ChoiceType ' , array ('&a ' , '&c ' ), array (
969
- 'choices ' => array ('&a ' => 'Choice&A ' , '&b ' => 'Choice&B ' , '&c ' => 'Choice&C ' ),
995
+ 'choices ' => array ('Choice&A ' => '&a ' , 'Choice&B ' => '&b ' , 'Choice&C ' => '&c ' ),
996
+ 'choices_as_values ' => true ,
970
997
'choice_attr ' => array ('Choice&B ' => array ('class ' => 'foo&bar ' )),
971
998
'multiple ' => true ,
972
999
'expanded ' => true ,
0 commit comments