Skip to content

Commit

Permalink
Added test
Browse files Browse the repository at this point in the history
  • Loading branch information
davidwindell committed Jul 27, 2012
1 parent e1690c1 commit 7c5abd3
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/Zend/Form/FormTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -872,4 +872,21 @@ public function testAssertElementsNamesCanBeWrappedAroundFormName()
$this->assertEquals('foo[colors][0]', $form->get('colors')->get('0')->getName());
$this->assertEquals('foo[fieldsets][0][field]', $form->get('fieldsets')->get('0')->get('field')->getName());
}

public function testEmptyValuesNotBound()
{
$this->populateForm();
$validSet = array(
'foo' => null,
'bar' => ' ALWAYS valid ',
'foobar' => array(
'foo' => 'abcde',
'bar' => ' ALWAYS valid',
),
);
$this->form->setData($validSet);
$this->form->isValid();
$data = $this->form->getData(Form::VALUES_RAW);
$this->assertEmpty($data['foo']);
}
}

0 comments on commit 7c5abd3

Please sign in to comment.