Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added test

  • Loading branch information...
commit f845cb2d16be59b71da5d47081826a248ad61eae 1 parent 7387a46
@davidwindell authored
Showing with 22 additions and 0 deletions.
  1. +22 −0 tests/ZendTest/Form/FormTest.php
View
22 tests/ZendTest/Form/FormTest.php
@@ -959,6 +959,28 @@ public function testApplyObjectInputFilterToBaseFieldsetAndApplyValidationGroup(
$this->assertTrue($this->form->isValid());
}
+ public function testAddNonBaseFieldsetObjectInputFilterToFormInputFilter()
+ {
+ $fieldset = new Fieldset('foobar');
+ $fieldset->add(new Element('foo'));
+ $fieldset->setUseAsBaseFieldset(false);
+ $this->form->add($fieldset);
+
+ $inputFilterFactory = new InputFilterFactory();
+ $inputFilter = $inputFilterFactory->createInputFilter(array(
+ 'foo' => array(
+ 'name' => 'foo',
+ 'required' => true,
+ ),
+ ));
+ $model = new TestAsset\ValidatingModel();
+ $model->setInputFilter($inputFilter);
+
+ $this->form->bind($model);
+
+ $this->assertInstanceOf('Zend\InputFilter\InputFilterInterface', $this->form->getInputFilter()->get('foobar'));
+ }
+
public function testExtractDataHydratorStrategy()
{
$this->populateHydratorStrategyForm();
Please sign in to comment.
Something went wrong with that request. Please try again.