-
Notifications
You must be signed in to change notification settings - Fork 49
Delegate to InputInterface::isValid when data not exists #30
Delegate to InputInterface::isValid when data not exists #30
Conversation
At this moment this pending of discussion. TODO remove tests from BaseInputFilter and place it on Input |
d336c96
to
49a7aaa
Compare
This looks sane; please rebase and proceed, and let me know when you're ready for final review. |
@weierophinney This become broken due the assumption of fallback values for missing data does not add the input to the valid inputs collection. |
49a7aaa
to
7f29c92
Compare
4380856
to
225ae39
Compare
@weierophinney This undo the change on #22 while merging. Fallback value shouldn't never to be exposed and used for build validation rules. |
ae84bd0
to
651e553
Compare
$this->assertEquals($bar->getFallbackValue(), $data['bar']); | ||
$this->assertArrayHasKey('bar', $filter->getValidInput()); | ||
$this->assertArrayNotHasKey('bar', $filter->getInvalidInput()); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do the above tests fail with the change? Or are equivalent tests introduced? If these tests still pass, I'd like to keep them in place, as they document changes that were introduced with #10.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no test ensuring any valid input (i.e isValid > true) must appear on getValidInput result.
This will be added on the test refactor where all outputs are tested at once for ensure there is no edge cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And yep, test was failing https://travis-ci.org/zendframework/zend-inputfilter/jobs/77456631#L258
This Pr undo #22
This methods provide a flag for distinguish when $value contains a real or the default property value.
651e553
to
c1bf8dc
Compare
Delegate to input isValid grant full control about the fallback value feature. This commit also consolidate Input::setFallbackValue tests
e4ad477
to
de0e3c9
Compare
Delegate to InputInterface::isValid when data not exists
This change is BC compatible with #10. Both depends of the specific subclass
Input
About #7 there is things for to discuss if this is BC break or not.
Basically the question to discuss it's if
InputInterface::isValid()
should be the responsible to decide all cases where an input is invalid or if we wantBaseInputFilter
to decide that. Note I used hereBaseInputFilter
and notInputFilterInterface
because only that class had so many matches about theInputInterface|Input
state.Revert interpretation of #22 change on merge
Supersede and close #29