From 2a16e87aecd8482e38235b083a89acf115542bb3 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Fri, 27 Nov 2015 14:24:26 +0100 Subject: [PATCH] [Form] Fix missing choices_as_values=true in tests --- .../Tests/AbstractBootstrap3LayoutTest.php | 77 ++++++++++++------- .../Form/Tests/AbstractDivLayoutTest.php | 3 +- .../Form/Tests/AbstractLayoutTest.php | 77 ++++++++++++------- 3 files changed, 104 insertions(+), 53 deletions(-) diff --git a/src/Symfony/Component/Form/Tests/AbstractBootstrap3LayoutTest.php b/src/Symfony/Component/Form/Tests/AbstractBootstrap3LayoutTest.php index 7ee2d5b352..3bafd0ea24 100644 --- a/src/Symfony/Component/Form/Tests/AbstractBootstrap3LayoutTest.php +++ b/src/Symfony/Component/Form/Tests/AbstractBootstrap3LayoutTest.php @@ -212,7 +212,8 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest public function testSingleChoice() { $form = $this->factory->createNamed('name', 'choice', '&a', array( - 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + 'choices_as_values' => true, 'multiple' => false, 'expanded' => false, )); @@ -234,7 +235,8 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest public function testSingleChoiceWithoutTranslation() { $form = $this->factory->createNamed('name', 'choice', '&a', array( - 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + 'choices_as_values' => true, 'multiple' => false, 'expanded' => false, 'choice_translation_domain' => false, @@ -257,7 +259,8 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest public function testSingleChoiceAttributes() { $form = $this->factory->createNamed('name', 'choice', '&a', array( - 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + 'choices_as_values' => true, 'choice_attr' => array('Choice&B' => array('class' => 'foo&bar')), 'multiple' => false, 'expanded' => false, @@ -282,7 +285,8 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest public function testSingleChoiceWithPreferred() { $form = $this->factory->createNamed('name', 'choice', '&a', array( - 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + 'choices_as_values' => true, 'preferred_choices' => array('&b'), 'multiple' => false, 'expanded' => false, @@ -306,7 +310,8 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest public function testSingleChoiceWithPreferredAndNoSeparator() { $form = $this->factory->createNamed('name', 'choice', '&a', array( - 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + 'choices_as_values' => true, 'preferred_choices' => array('&b'), 'multiple' => false, 'expanded' => false, @@ -329,7 +334,8 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest public function testSingleChoiceWithPreferredAndBlankSeparator() { $form = $this->factory->createNamed('name', 'choice', '&a', array( - 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + 'choices_as_values' => true, 'preferred_choices' => array('&b'), 'multiple' => false, 'expanded' => false, @@ -353,7 +359,8 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest public function testChoiceWithOnlyPreferred() { $form = $this->factory->createNamed('name', 'choice', '&a', array( - 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + 'choices_as_values' => true, 'preferred_choices' => array('&a', '&b'), 'multiple' => false, 'expanded' => false, @@ -370,7 +377,8 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest public function testSingleChoiceNonRequired() { $form = $this->factory->createNamed('name', 'choice', '&a', array( - 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + 'choices_as_values' => true, 'required' => false, 'multiple' => false, 'expanded' => false, @@ -394,7 +402,8 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest public function testSingleChoiceNonRequiredNoneSelected() { $form = $this->factory->createNamed('name', 'choice', null, array( - 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + 'choices_as_values' => true, 'required' => false, 'multiple' => false, 'expanded' => false, @@ -418,7 +427,8 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest public function testSingleChoiceNonRequiredWithPlaceholder() { $form = $this->factory->createNamed('name', 'choice', '&a', array( - 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + 'choices_as_values' => true, 'multiple' => false, 'expanded' => false, 'required' => false, @@ -443,7 +453,8 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest public function testSingleChoiceRequiredWithPlaceholder() { $form = $this->factory->createNamed('name', 'choice', '&a', array( - 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + 'choices_as_values' => true, 'required' => true, 'multiple' => false, 'expanded' => false, @@ -468,7 +479,8 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest public function testSingleChoiceRequiredWithPlaceholderViaView() { $form = $this->factory->createNamed('name', 'choice', '&a', array( - 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + 'choices_as_values' => true, 'required' => true, 'multiple' => false, 'expanded' => false, @@ -493,9 +505,10 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest { $form = $this->factory->createNamed('name', 'choice', '&a', array( 'choices' => array( - 'Group&1' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), - 'Group&2' => array('&c' => 'Choice&C'), + 'Group&1' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + 'Group&2' => array('Choice&C' => '&c'), ), + 'choices_as_values' => true, 'multiple' => false, 'expanded' => false, )); @@ -523,7 +536,8 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest public function testMultipleChoice() { $form = $this->factory->createNamed('name', 'choice', array('&a'), array( - 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + 'choices_as_values' => true, 'required' => true, 'multiple' => true, 'expanded' => false, @@ -547,7 +561,8 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest public function testMultipleChoiceAttributes() { $form = $this->factory->createNamed('name', 'choice', array('&a'), array( - 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + 'choices_as_values' => true, 'choice_attr' => array('Choice&B' => array('class' => 'foo&bar')), 'required' => true, 'multiple' => true, @@ -574,7 +589,8 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest public function testMultipleChoiceSkipsPlaceholder() { $form = $this->factory->createNamed('name', 'choice', array('&a'), array( - 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + 'choices_as_values' => true, 'multiple' => true, 'expanded' => false, 'placeholder' => 'Test&Me', @@ -597,7 +613,8 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest public function testMultipleChoiceNonRequired() { $form = $this->factory->createNamed('name', 'choice', array('&a'), array( - 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + 'choices_as_values' => true, 'required' => false, 'multiple' => true, 'expanded' => false, @@ -620,7 +637,8 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest public function testSingleChoiceExpanded() { $form = $this->factory->createNamed('name', 'choice', '&a', array( - 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + 'choices_as_values' => true, 'multiple' => false, 'expanded' => true, )); @@ -655,7 +673,8 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest public function testSingleChoiceExpandedWithoutTranslation() { $form = $this->factory->createNamed('name', 'choice', '&a', array( - 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + 'choices_as_values' => true, 'multiple' => false, 'expanded' => true, 'choice_translation_domain' => false, @@ -691,7 +710,8 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest public function testSingleChoiceExpandedAttributes() { $form = $this->factory->createNamed('name', 'choice', '&a', array( - 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + 'choices_as_values' => true, 'choice_attr' => array('Choice&B' => array('class' => 'foo&bar')), 'multiple' => false, 'expanded' => true, @@ -729,7 +749,8 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest public function testSingleChoiceExpandedWithPlaceholder() { $form = $this->factory->createNamed('name', 'choice', '&a', array( - 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + 'choices_as_values' => true, 'multiple' => false, 'expanded' => true, 'placeholder' => 'Test&Me', @@ -774,7 +795,8 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest public function testSingleChoiceExpandedWithBooleanValue() { $form = $this->factory->createNamed('name', 'choice', true, array( - 'choices' => array('1' => 'Choice&A', '0' => 'Choice&B'), + 'choices' => array('Choice&A' => '1', 'Choice&B' => '0'), + 'choices_as_values' => true, 'multiple' => false, 'expanded' => true, )); @@ -809,7 +831,8 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest public function testMultipleChoiceExpanded() { $form = $this->factory->createNamed('name', 'choice', array('&a', '&c'), array( - 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B', '&c' => 'Choice&C'), + 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b', 'Choice&C' => '&c'), + 'choices_as_values' => true, 'multiple' => true, 'expanded' => true, 'required' => true, @@ -854,7 +877,8 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest public function testMultipleChoiceExpandedWithoutTranslation() { $form = $this->factory->createNamed('name', 'choice', array('&a', '&c'), array( - 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B', '&c' => 'Choice&C'), + 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b', 'Choice&C' => '&c'), + 'choices_as_values' => true, 'multiple' => true, 'expanded' => true, 'required' => true, @@ -900,7 +924,8 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest public function testMultipleChoiceExpandedAttributes() { $form = $this->factory->createNamed('name', 'choice', array('&a', '&c'), array( - 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B', '&c' => 'Choice&C'), + 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b', 'Choice&C' => '&c'), + 'choices_as_values' => true, 'choice_attr' => array('Choice&B' => array('class' => 'foo&bar')), 'multiple' => true, 'expanded' => true, diff --git a/src/Symfony/Component/Form/Tests/AbstractDivLayoutTest.php b/src/Symfony/Component/Form/Tests/AbstractDivLayoutTest.php index 45b2f311c2..7eeeac0a02 100644 --- a/src/Symfony/Component/Form/Tests/AbstractDivLayoutTest.php +++ b/src/Symfony/Component/Form/Tests/AbstractDivLayoutTest.php @@ -692,7 +692,8 @@ abstract class AbstractDivLayoutTest extends AbstractLayoutTest public function testChoiceRowWithCustomBlock() { $form = $this->factory->createNamedBuilder('name_c', 'choice', 'a', array( - 'choices' => array('a' => 'ChoiceA', 'b' => 'ChoiceB'), + 'choices' => array('ChoiceA' => 'a', 'ChoiceB' => 'b'), + 'choices_as_values' => true, 'expanded' => true, )) ->getForm(); diff --git a/src/Symfony/Component/Form/Tests/AbstractLayoutTest.php b/src/Symfony/Component/Form/Tests/AbstractLayoutTest.php index 64ecec9b49..0939a2b003 100644 --- a/src/Symfony/Component/Form/Tests/AbstractLayoutTest.php +++ b/src/Symfony/Component/Form/Tests/AbstractLayoutTest.php @@ -497,7 +497,8 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg public function testSingleChoice() { $form = $this->factory->createNamed('name', 'choice', '&a', array( - 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + 'choices_as_values' => true, 'multiple' => false, 'expanded' => false, )); @@ -530,7 +531,8 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg public function testSingleChoiceWithoutTranslation() { $form = $this->factory->createNamed('name', 'choice', '&a', array( - 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + 'choices_as_values' => true, 'multiple' => false, 'expanded' => false, 'choice_translation_domain' => false, @@ -552,7 +554,8 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg public function testSingleChoiceAttributes() { $form = $this->factory->createNamed('name', 'choice', '&a', array( - 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + 'choices_as_values' => true, 'choice_attr' => array('Choice&B' => array('class' => 'foo&bar')), 'multiple' => false, 'expanded' => false, @@ -576,7 +579,8 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg public function testSingleChoiceWithPreferred() { $form = $this->factory->createNamed('name', 'choice', '&a', array( - 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + 'choices_as_values' => true, 'preferred_choices' => array('&b'), 'multiple' => false, 'expanded' => false, @@ -599,7 +603,8 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg public function testSingleChoiceWithPreferredAndNoSeparator() { $form = $this->factory->createNamed('name', 'choice', '&a', array( - 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + 'choices_as_values' => true, 'preferred_choices' => array('&b'), 'multiple' => false, 'expanded' => false, @@ -621,7 +626,8 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg public function testSingleChoiceWithPreferredAndBlankSeparator() { $form = $this->factory->createNamed('name', 'choice', '&a', array( - 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + 'choices_as_values' => true, 'preferred_choices' => array('&b'), 'multiple' => false, 'expanded' => false, @@ -644,7 +650,8 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg public function testChoiceWithOnlyPreferred() { $form = $this->factory->createNamed('name', 'choice', '&a', array( - 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + 'choices_as_values' => true, 'preferred_choices' => array('&a', '&b'), 'multiple' => false, 'expanded' => false, @@ -660,7 +667,8 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg public function testSingleChoiceNonRequired() { $form = $this->factory->createNamed('name', 'choice', '&a', array( - 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + 'choices_as_values' => true, 'required' => false, 'multiple' => false, 'expanded' => false, @@ -683,7 +691,8 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg public function testSingleChoiceNonRequiredNoneSelected() { $form = $this->factory->createNamed('name', 'choice', null, array( - 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + 'choices_as_values' => true, 'required' => false, 'multiple' => false, 'expanded' => false, @@ -706,7 +715,8 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg public function testSingleChoiceNonRequiredWithPlaceholder() { $form = $this->factory->createNamed('name', 'choice', '&a', array( - 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + 'choices_as_values' => true, 'multiple' => false, 'expanded' => false, 'required' => false, @@ -730,7 +740,8 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg public function testSingleChoiceRequiredWithPlaceholder() { $form = $this->factory->createNamed('name', 'choice', '&a', array( - 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + 'choices_as_values' => true, 'required' => true, 'multiple' => false, 'expanded' => false, @@ -757,7 +768,8 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg public function testSingleChoiceRequiredWithPlaceholderViaView() { $form = $this->factory->createNamed('name', 'choice', '&a', array( - 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + 'choices_as_values' => true, 'required' => true, 'multiple' => false, 'expanded' => false, @@ -784,9 +796,10 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg { $form = $this->factory->createNamed('name', 'choice', '&a', array( 'choices' => array( - 'Group&1' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), - 'Group&2' => array('&c' => 'Choice&C'), + 'Group&1' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + 'Group&2' => array('Choice&C' => '&c'), ), + 'choices_as_values' => true, 'multiple' => false, 'expanded' => false, )); @@ -813,7 +826,8 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg public function testMultipleChoice() { $form = $this->factory->createNamed('name', 'choice', array('&a'), array( - 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + 'choices_as_values' => true, 'required' => true, 'multiple' => true, 'expanded' => false, @@ -836,7 +850,8 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg public function testMultipleChoiceAttributes() { $form = $this->factory->createNamed('name', 'choice', array('&a'), array( - 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + 'choices_as_values' => true, 'choice_attr' => array('Choice&B' => array('class' => 'foo&bar')), 'required' => true, 'multiple' => true, @@ -862,7 +877,8 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg public function testMultipleChoiceSkipsPlaceholder() { $form = $this->factory->createNamed('name', 'choice', array('&a'), array( - 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + 'choices_as_values' => true, 'multiple' => true, 'expanded' => false, 'placeholder' => 'Test&Me', @@ -884,7 +900,8 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg public function testMultipleChoiceNonRequired() { $form = $this->factory->createNamed('name', 'choice', array('&a'), array( - 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + 'choices_as_values' => true, 'required' => false, 'multiple' => true, 'expanded' => false, @@ -906,7 +923,8 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg public function testSingleChoiceExpanded() { $form = $this->factory->createNamed('name', 'choice', '&a', array( - 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + 'choices_as_values' => true, 'multiple' => false, 'expanded' => true, )); @@ -928,7 +946,8 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg public function testSingleChoiceExpandedWithoutTranslation() { $form = $this->factory->createNamed('name', 'choice', '&a', array( - 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + 'choices_as_values' => true, 'multiple' => false, 'expanded' => true, 'choice_translation_domain' => false, @@ -951,7 +970,8 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg public function testSingleChoiceExpandedAttributes() { $form = $this->factory->createNamed('name', 'choice', '&a', array( - 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + 'choices_as_values' => true, 'choice_attr' => array('Choice&B' => array('class' => 'foo&bar')), 'multiple' => false, 'expanded' => true, @@ -976,7 +996,8 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg public function testSingleChoiceExpandedWithPlaceholder() { $form = $this->factory->createNamed('name', 'choice', '&a', array( - 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'), + 'choices_as_values' => true, 'multiple' => false, 'expanded' => true, 'placeholder' => 'Test&Me', @@ -1001,7 +1022,8 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg public function testSingleChoiceExpandedWithBooleanValue() { $form = $this->factory->createNamed('name', 'choice', true, array( - 'choices' => array('1' => 'Choice&A', '0' => 'Choice&B'), + 'choices' => array('Choice&A' => '1', 'Choice&B' => '0'), + 'choices_as_values' => true, 'multiple' => false, 'expanded' => true, )); @@ -1023,7 +1045,8 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg public function testMultipleChoiceExpanded() { $form = $this->factory->createNamed('name', 'choice', array('&a', '&c'), array( - 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B', '&c' => 'Choice&C'), + 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b', 'Choice&C' => '&c'), + 'choices_as_values' => true, 'multiple' => true, 'expanded' => true, 'required' => true, @@ -1048,7 +1071,8 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg public function testMultipleChoiceExpandedWithoutTranslation() { $form = $this->factory->createNamed('name', 'choice', array('&a', '&c'), array( - 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B', '&c' => 'Choice&C'), + 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b', 'Choice&C' => '&c'), + 'choices_as_values' => true, 'multiple' => true, 'expanded' => true, 'required' => true, @@ -1074,7 +1098,8 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg public function testMultipleChoiceExpandedAttributes() { $form = $this->factory->createNamed('name', 'choice', array('&a', '&c'), array( - 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B', '&c' => 'Choice&C'), + 'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b', 'Choice&C' => '&c'), + 'choices_as_values' => true, 'choice_attr' => array('Choice&B' => array('class' => 'foo&bar')), 'multiple' => true, 'expanded' => true,