Skip to content

Commit

Permalink
[Form] ChoiceField test for using ArrayObject as choices option
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Mikola committed Sep 9, 2010
1 parent 6fc9b68 commit 2b776bf
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/Symfony/Tests/Component/Form/ChoiceFieldTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 2b776bf

Please sign in to comment.