diff --git a/tests/Symfony/Tests/Component/Form/AbstractDivLayoutTest.php b/tests/Symfony/Tests/Component/Form/AbstractDivLayoutTest.php index 1cdd64d802a9..1a72e3ad6fe1 100644 --- a/tests/Symfony/Tests/Component/Form/AbstractDivLayoutTest.php +++ b/tests/Symfony/Tests/Component/Form/AbstractDivLayoutTest.php @@ -238,7 +238,7 @@ public function testRestAndRepeatedWithWidgetPerField() ->getForm() ->createView(); - // The password form is considered as rendered as all its childrend + // The password form is considered as rendered as all its children // are rendered $this->renderWidget($view['password']['first']); $this->renderWidget($view['password']['second']); @@ -372,7 +372,7 @@ public function testRepeated() public function testRepeatedWithCustomOptions() { $form = $this->factory->createNamed('repeated', 'name', null, array( - 'first_options' => array('label' => 'Test', 'required' => false), + 'first_options' => array('label' => 'Test'), 'second_options' => array('label' => 'Test2') )); diff --git a/tests/Symfony/Tests/Component/Form/Extension/Core/Type/RepeatedTypeTest.php b/tests/Symfony/Tests/Component/Form/Extension/Core/Type/RepeatedTypeTest.php index 654b8764cdfd..7a260a5bb8f3 100644 --- a/tests/Symfony/Tests/Component/Form/Extension/Core/Type/RepeatedTypeTest.php +++ b/tests/Symfony/Tests/Component/Form/Extension/Core/Type/RepeatedTypeTest.php @@ -53,7 +53,7 @@ public function testSetOptionsPerField() { $form = $this->factory->create('repeated', null, array( 'type' => 'field', - 'first_options' => array('label' => 'Test', 'required' => false), + 'first_options' => array('label' => 'Test'), 'second_options' => array('label' => 'Test2') )); @@ -63,6 +63,17 @@ public function testSetOptionsPerField() $this->assertTrue($form['second']->isRequired()); } + public function testSetRequired() + { + $form = $this->factory->create('repeated', null, array( + 'required' => false, + 'type' => 'field', + )); + + $this->assertFalse($form['first']->isRequired()); + $this->assertFalse($form['second']->isRequired()); + } + public function testSetOptionsPerFieldAndOverwrite() { $form = $this->factory->create('repeated', null, array(