Skip to content

Commit de9f8ab

Browse files
committed
added a unit test for previous merge
1 parent c248f81 commit de9f8ab

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/Symfony/Tests/Component/Form/AbstractLayoutTest.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,23 @@ public function testSingleChoiceWithPreferred()
383383
);
384384
}
385385

386+
public function testChoiceWithOnlyPreferred()
387+
{
388+
$form = $this->factory->createNamed('choice', 'na&me', '&a', array(
389+
'property_path' => 'name',
390+
'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'),
391+
'preferred_choices' => array('&a', '&b'),
392+
'multiple' => false,
393+
'expanded' => false,
394+
));
395+
396+
$this->assertWidgetMatchesXpath($form->createView(), array(),
397+
'/select
398+
[count(./option)=2]
399+
'
400+
);
401+
}
402+
386403
public function testSingleChoiceNonRequired()
387404
{
388405
$form = $this->factory->createNamed('choice', 'na&me', '&a', array(

0 commit comments

Comments
 (0)