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

Commit eccaff9

Browse files
committed
Merge branch 'hotfix/22'
Close #22
2 parents 958585d + 0ee288b commit eccaff9

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
@@ -18,6 +18,12 @@ All notable changes to this project will be documented in this file, in reverse
1818

1919
### Fixed
2020

21+
- [#22](https://github.com/zendframework/zend-inputfilter/pull/22) adds tests to
22+
verify two conditions around inputs with fallback values:
23+
- If the input was not in the data set, it should not be represented in either
24+
the list of valid *or* invalid inputs.
25+
- If the input *was* in the data set, but empty, it should be represented in
26+
the list of valid inputs.
2127
- [#31](https://github.com/zendframework/zend-inputfilter/pull/31) updates the
2228
`InputFilterInterface::add()` docblock to match existing, shipped implementations.
2329
- [#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)