File tree Expand file tree Collapse file tree 2 files changed +18
-5
lines changed
src/Symfony/Component/Validator Expand file tree Collapse file tree 2 files changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,10 @@ private static function isFieldsOption($options): bool
103
103
return true ;
104
104
}
105
105
106
+ if (null === $ optionOrField ) {
107
+ return true ;
108
+ }
109
+
106
110
if (!\is_array ($ optionOrField )) {
107
111
return false ;
108
112
}
Original file line number Diff line number Diff line change @@ -175,10 +175,15 @@ public function testEmptyFieldsInOptions()
175
175
$ this ->assertSame ('foo bar baz ' , $ constraint ->extraFieldsMessage );
176
176
}
177
177
178
- public function testEmptyConstraintListFor ()
178
+ /**
179
+ * @testWith [[]]
180
+ * [null]
181
+ */
182
+ public function testEmptyConstraintListForField (?array $ fieldConstraint )
179
183
{
180
- $ constraint = new Collection ([
181
- 'foo ' => [],
184
+ $ constraint = new Collection (
185
+ [
186
+ 'foo ' => $ fieldConstraint ,
182
187
],
183
188
null ,
184
189
null ,
@@ -193,11 +198,15 @@ public function testEmptyConstraintListFor()
193
198
$ this ->assertSame ('foo bar baz ' , $ constraint ->extraFieldsMessage );
194
199
}
195
200
196
- public function testEmptyConstraintListForFieldInOptions ()
201
+ /**
202
+ * @testWith [[]]
203
+ * [null]
204
+ */
205
+ public function testEmptyConstraintListForFieldInOptions (?array $ fieldConstraint )
197
206
{
198
207
$ constraint = new Collection ([
199
208
'fields ' => [
200
- 'foo ' => [] ,
209
+ 'foo ' => $ fieldConstraint ,
201
210
],
202
211
'allowExtraFields ' => true ,
203
212
'extraFieldsMessage ' => 'foo bar baz ' ,
You can’t perform that action at this time.
0 commit comments