Merge branch '2.7' into 2.8

* 2.7:
  [Form] Fix missing choices_as_values=true in tests

Conflicts:
	src/Symfony/Component/Form/Tests/AbstractBootstrap3LayoutTest.php
	src/Symfony/Component/Form/Tests/AbstractDivLayoutTest.php
	src/Symfony/Component/Form/Tests/AbstractLayoutTest.php
This commit is contained in:
Nicolas Grekas 2015-11-27 15:19:27 +01:00
commit de08816caa
3 changed files with 112 additions and 57 deletions

View File

@ -212,7 +212,8 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
public function testSingleChoice()
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&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', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&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 testSingleChoiceWithPlaceholderWithoutTranslation()
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&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,
@ -283,7 +286,8 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
public function testSingleChoiceAttributes()
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&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,
@ -308,7 +312,8 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
public function testSingleChoiceWithPreferred()
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&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,
@ -332,7 +337,8 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
public function testSingleChoiceWithPreferredAndNoSeparator()
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&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,
@ -355,7 +361,8 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
public function testSingleChoiceWithPreferredAndBlankSeparator()
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&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,
@ -379,7 +386,8 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
public function testChoiceWithOnlyPreferred()
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&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,
@ -396,7 +404,8 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
public function testSingleChoiceNonRequired()
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&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,
@ -420,7 +429,8 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
public function testSingleChoiceNonRequiredNoneSelected()
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', 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,
@ -444,7 +454,8 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
public function testSingleChoiceNonRequiredWithPlaceholder()
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&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,
@ -469,7 +480,8 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
public function testSingleChoiceRequiredWithPlaceholder()
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&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,
@ -494,7 +506,8 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
public function testSingleChoiceRequiredWithPlaceholderViaView()
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&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,
@ -519,9 +532,10 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&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,
));
@ -549,7 +563,8 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
public function testMultipleChoice()
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', 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,
@ -573,7 +588,8 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
public function testMultipleChoiceAttributes()
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', 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,
@ -600,7 +616,8 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
public function testMultipleChoiceSkipsPlaceholder()
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', 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',
@ -623,7 +640,8 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
public function testMultipleChoiceNonRequired()
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', 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,
@ -646,7 +664,8 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
public function testSingleChoiceExpanded()
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&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,
));
@ -681,7 +700,8 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
public function testSingleChoiceExpandedWithoutTranslation()
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&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,
@ -717,7 +737,8 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
public function testSingleChoiceExpandedAttributes()
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&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,
@ -755,7 +776,8 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
public function testSingleChoiceExpandedWithPlaceholder()
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&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',
@ -800,7 +822,8 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
public function testSingleChoiceExpandedWithPlaceholderWithoutTranslation()
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&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,
'translation_domain' => false,
@ -846,7 +869,8 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
public function testSingleChoiceExpandedWithBooleanValue()
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', 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,
));
@ -881,7 +905,8 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
public function testMultipleChoiceExpanded()
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', 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,
@ -926,7 +951,8 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
public function testMultipleChoiceExpandedWithoutTranslation()
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', 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,
@ -972,7 +998,8 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
public function testMultipleChoiceExpandedAttributes()
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', 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,

View File

@ -691,7 +691,8 @@ abstract class AbstractDivLayoutTest extends AbstractLayoutTest
public function testChoiceRowWithCustomBlock()
{
$form = $this->factory->createNamedBuilder('name_c', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', 'a', array(
'choices' => array('a' => 'ChoiceA', 'b' => 'ChoiceB'),
'choices' => array('ChoiceA' => 'a', 'ChoiceB' => 'b'),
'choices_as_values' => true,
'expanded' => true,
))
->getForm();

View File

@ -516,7 +516,8 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg
public function testSingleChoice()
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&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,
));
@ -549,7 +550,8 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg
public function testSingleChoiceWithoutTranslation()
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&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,
@ -571,7 +573,8 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg
public function testSingleChoiceWithPlaceholderWithoutTranslation()
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&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,
@ -596,7 +599,8 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg
public function testSingleChoiceAttributes()
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&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,
@ -620,7 +624,8 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg
public function testSingleChoiceWithPreferred()
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&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,
@ -643,7 +648,8 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg
public function testSingleChoiceWithPreferredAndNoSeparator()
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&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,
@ -665,7 +671,8 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg
public function testSingleChoiceWithPreferredAndBlankSeparator()
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&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,
@ -688,7 +695,8 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg
public function testChoiceWithOnlyPreferred()
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&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,
@ -704,7 +712,8 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg
public function testSingleChoiceNonRequired()
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&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,
@ -727,7 +736,8 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg
public function testSingleChoiceNonRequiredNoneSelected()
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', 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,
@ -750,7 +760,8 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg
public function testSingleChoiceNonRequiredWithPlaceholder()
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&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,
@ -774,7 +785,8 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg
public function testSingleChoiceRequiredWithPlaceholder()
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&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,
@ -801,7 +813,8 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg
public function testSingleChoiceRequiredWithPlaceholderViaView()
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&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,
@ -828,9 +841,10 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&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,
));
@ -857,7 +871,8 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg
public function testMultipleChoice()
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', 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,
@ -880,7 +895,8 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg
public function testMultipleChoiceAttributes()
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', 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,
@ -906,7 +922,8 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg
public function testMultipleChoiceSkipsPlaceholder()
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', 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',
@ -928,7 +945,8 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg
public function testMultipleChoiceNonRequired()
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', 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,
@ -950,7 +968,8 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg
public function testSingleChoiceExpanded()
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&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,
));
@ -972,7 +991,8 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg
public function testSingleChoiceExpandedWithoutTranslation()
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&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,
@ -995,7 +1015,8 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg
public function testSingleChoiceExpandedAttributes()
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&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,
@ -1020,7 +1041,8 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg
public function testSingleChoiceExpandedWithPlaceholder()
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&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',
@ -1045,7 +1067,8 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg
public function testSingleChoiceExpandedWithPlaceholderWithoutTranslation()
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&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,
'translation_domain' => false,
@ -1071,7 +1094,8 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg
public function testSingleChoiceExpandedWithBooleanValue()
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', 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,
));
@ -1093,7 +1117,8 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg
public function testMultipleChoiceExpanded()
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', 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,
@ -1118,7 +1143,8 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg
public function testMultipleChoiceExpandedWithoutTranslation()
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', 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,
@ -1144,7 +1170,8 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg
public function testMultipleChoiceExpandedAttributes()
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', 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,