Skip to content
This repository was archived by the owner on Jan 30, 2020. It is now read-only.

Commit db9d949

Browse files
committed
Merge branch 'hotfix/22' into develop
Forward port #22
2 parents 5dbf6e9 + 0ee288b commit db9d949

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ All notable changes to this project will be documented in this file, in reverse
3636

3737
### Fixed
3838

39+
- [#22](https://github.com/zendframework/zend-inputfilter/pull/22) adds tests to
40+
verify two conditions around inputs with fallback values:
41+
- If the input was not in the data set, it should not be represented in either
42+
the list of valid *or* invalid inputs.
43+
- If the input *was* in the data set, but empty, it should be represented in
44+
the list of valid inputs.
3945
- [#31](https://github.com/zendframework/zend-inputfilter/pull/31) updates the
4046
`InputFilterInterface::add()` docblock to match existing, shipped implementations.
4147
- [#25](https://github.com/zendframework/zend-inputfilter/pull/25) updates the

test/BaseInputFilterTest.php

+4
Original file line numberDiff line numberDiff line change
@@ -1082,6 +1082,8 @@ public function testMissingRequiredThatAllowsEmptyWithFallbackShouldMarkInputVal
10821082
$data = $filter->getValues();
10831083
$this->assertArrayHasKey('bar', $data);
10841084
$this->assertEquals($bar->getFallbackValue(), $data['bar']);
1085+
$this->assertArrayNotHasKey('bar', $filter->getValidInput());
1086+
$this->assertArrayNotHasKey('bar', $filter->getInvalidInput());
10851087
}
10861088

10871089
/**
@@ -1109,6 +1111,8 @@ public function testEmptyRequiredValueWithFallbackShouldMarkInputValid()
11091111
$data = $filter->getValues();
11101112
$this->assertArrayHasKey('bar', $data);
11111113
$this->assertEquals($bar->getFallbackValue(), $data['bar']);
1114+
$this->assertArrayHasKey('bar', $filter->getValidInput());
1115+
$this->assertArrayNotHasKey('bar', $filter->getInvalidInput());
11121116
}
11131117

11141118
/**

0 commit comments

Comments
 (0)