diff --git a/CHANGELOG.md b/CHANGELOG.md index cee927f0..8f49d1d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,8 @@ All notable changes to this project will be documented in this file, in reverse ### Fixed -- Nothing. +- [#72](https://github.com/zendframework/zend-inputfilter/pull/72) `ArrayInput` + value is properly reset after `BaseInputFilter::setData()` ## 2.5.5 - 2015-09-03 diff --git a/src/BaseInputFilter.php b/src/BaseInputFilter.php index 1fea9709..5ccfdf44 100644 --- a/src/BaseInputFilter.php +++ b/src/BaseInputFilter.php @@ -512,11 +512,6 @@ protected function populate() continue; } - if ($input instanceof ArrayInput) { - $input->setValue([]); - continue; - } - if ($input instanceof Input) { $input->resetValue(); continue; diff --git a/test/BaseInputFilterTest.php b/test/BaseInputFilterTest.php index 692adc93..e55d9927 100644 --- a/test/BaseInputFilterTest.php +++ b/test/BaseInputFilterTest.php @@ -15,7 +15,6 @@ use PHPUnit_Framework_MockObject_MockObject as MockObject; use PHPUnit_Framework_TestCase as TestCase; use stdClass; -use Zend\InputFilter\ArrayInput; use Zend\InputFilter\BaseInputFilter; use Zend\InputFilter\Exception\InvalidArgumentException; use Zend\InputFilter\Exception\RuntimeException; @@ -556,23 +555,6 @@ public function testAddingExistingInputWillMergeIntoExisting() $this->assertFalse($filter->get('foo')->isRequired()); } - /** - * @group 5638 - */ - public function testPopulateSupportsArrayInputEvenIfDataMissing() - { - /** @var ArrayInput|MockObject $arrayInput */ - $arrayInput = $this->getMock(ArrayInput::class); - $arrayInput - ->expects($this->once()) - ->method('setValue') - ->with([]); - - $filter = $this->inputFilter; - $filter->add($arrayInput, 'arrayInput'); - $filter->setData(['foo' => 'bar']); - } - /** * @group 6431 */