From 2b776bf2e8b3d4c1003b12655f43b4fca1172ccf Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Mon, 5 Jul 2010 18:56:04 -0400 Subject: [PATCH] [Form] ChoiceField test for using ArrayObject as choices option --- .../Tests/Component/Form/ChoiceFieldTest.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/Symfony/Tests/Component/Form/ChoiceFieldTest.php b/tests/Symfony/Tests/Component/Form/ChoiceFieldTest.php index 029278da18..e0cbd6edef 100644 --- a/tests/Symfony/Tests/Component/Form/ChoiceFieldTest.php +++ b/tests/Symfony/Tests/Component/Form/ChoiceFieldTest.php @@ -28,6 +28,20 @@ class ChoiceFieldTest extends \PHPUnit_Framework_TestCase ) ); + public function testConfigureChoicesWithArrayObject() + { + $choices = new \ArrayObject($this->choices); + + $field = new ChoiceField('name', array( + 'multiple' => false, + 'expanded' => true, + 'choices' => $choices, + 'preferred_choices' => $this->preferredChoices, + )); + + $this->assertEquals($this->choices, $choices->getArrayCopy()); + } + public function testBindSingleNonExpanded() { $field = new ChoiceField('name', array(