Method getUnknown works wrong on CollectionInputFilter.
It was returning all fields, not only unknown.
It should work similar to isValid method - so unknown fields should be checked for each dataset and result should be collection of unknown fields (to be more specific pairs field => value).
So for example: we have input filter with field "foo" (and we are using this input filter in our CollectionInputFilter). The input data are:
[
['foo' => 'bar'],
['baz' => 'bar'],
]
so the second dataset (index 1!) has unknown field baz.
The result of getUnknown method should be:
[
1 => ['baz' => 'bar'],
]
but currently is exactly the same as the input data.
In this PR fixed behavior of this method in CollectionInputFilter + tests.
Also updated method hasUnknown to reuse getUnknown results.
Method
getUnknown
works wrong onCollectionInputFilter
. It was returning all fields, not only unknown.It should work similar to
isValid
method - so unknown fields should be checked for each dataset and result should be collection of unknown fields (to be more specific pairsfield => value
).So for example: we have input filter with field "foo" (and we are using this input filter in our CollectionInputFilter). The input data are:
so the second dataset (index 1!) has unknown field
baz
.The result of
getUnknown
method should be:but currently is exactly the same as the input data.
In this PR fixed behavior of this method in
CollectionInputFilter
+ tests. Also updated methodhasUnknown
to reusegetUnknown
results.