@@ -246,14 +246,14 @@ public static function getInvalidFieldNames(): array
246
246
/**
247
247
* @dataProvider getInvalidCollectionValues
248
248
*/
249
- public function testInvalidCollectionValues (array $ value , array $ fields )
249
+ public function testInvalidCollectionValues (array $ value , array $ fields, string $ expectedMessageParam )
250
250
{
251
251
$ this ->validator ->validate ($ value , new Unique ([
252
252
'message ' => 'myMessage ' ,
253
253
], fields: $ fields ));
254
254
255
255
$ this ->buildViolation ('myMessage ' )
256
- ->setParameter ('{{ value }} ' , ' array ' )
256
+ ->setParameter ('{{ value }} ' , $ expectedMessageParam )
257
257
->setCode (Unique::IS_NOT_UNIQUE )
258
258
->assertRaised ();
259
259
}
@@ -264,23 +264,25 @@ public static function getInvalidCollectionValues(): array
264
264
'unique string ' => [[
265
265
['lang ' => 'eng ' , 'translation ' => 'hi ' ],
266
266
['lang ' => 'eng ' , 'translation ' => 'hello ' ],
267
- ], ['lang ' ]],
267
+ ], ['lang ' ], ' array ' ],
268
268
'unique floats ' => [[
269
269
['latitude ' => 51.509865 , 'longitude ' => -0.118092 , 'poi ' => 'capital ' ],
270
270
['latitude ' => 52.520008 , 'longitude ' => 13.404954 ],
271
271
['latitude ' => 51.509865 , 'longitude ' => -0.118092 ],
272
- ], ['latitude ' , 'longitude ' ]],
272
+ ], ['latitude ' , 'longitude ' ], ' array ' ],
273
273
'unique int ' => [[
274
274
['id ' => 1 , 'email ' => 'bar@email.com ' ],
275
275
['id ' => 1 , 'email ' => 'foo@email.com ' ],
276
- ], ['id ' ]],
276
+ ], ['id ' ], ' array ' ],
277
277
'unique null ' => [
278
278
[null , null ],
279
279
[],
280
+ 'null ' ,
280
281
],
281
282
'unique field null ' => [
282
283
[['nullField ' => null ], ['nullField ' => null ]],
283
284
['nullField ' ],
285
+ 'array ' ,
284
286
],
285
287
];
286
288
}
0 commit comments