Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

CS Fix, Test & Typehint

  • Loading branch information...
commit 06cafeb25a82a987a4aea5a9fda5287181732676 1 parent 3b21e28
@davidwindell authored
Showing with 13 additions and 10 deletions.
  1. +3 −3 library/Zend/Form/Form.php
  2. +10 −7 tests/Zend/Form/FormTest.php
View
6 library/Zend/Form/Form.php
@@ -268,12 +268,12 @@ public function bindValues(array $values = array())
/**
* Parse filtered values and return only posted fields for binding
- *
+ *
* @param array $values
- * @param type $match
+ * @param array $match
* @return array
*/
- protected function prepareBindData(array $values, $match)
+ protected function prepareBindData(array $values, array $match)
{
$data = array();
foreach ($values as $name => $value) {
View
17 tests/Zend/Form/FormTest.php
@@ -873,20 +873,23 @@ public function testAssertElementsNamesCanBeWrappedAroundFormName()
$this->assertEquals('foo[fieldsets][0][field]', $form->get('fieldsets')->get('0')->get('field')->getName());
}
- public function testEmptyValuesNotBound()
+ public function testUnsetValuesNotBound()
{
- $this->populateForm();
+ $model = new stdClass;
$validSet = array(
- 'foo' => null,
- 'bar' => ' ALWAYS valid ',
+ 'bar' => 'always valid',
'foobar' => array(
'foo' => 'abcde',
- 'bar' => ' ALWAYS valid',
+ 'bar' => 'always valid',
),
);
+ $this->populateForm();
+ $this->form->setHydrator(new Hydrator\ObjectProperty());
+ $this->form->bind($model);
$this->form->setData($validSet);
$this->form->isValid();
- $data = $this->form->getData(Form::VALUES_RAW);
- $this->assertEmpty($data['foo']);
+ $data = $this->form->getData();
+ $this->assertClassNotHasAttribute('foo', $data);
+ $this->assertClassHasAttribute('bar', $data);
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.