Skip to content

Commit ee0a4d6

Browse files
committed
fix test
1 parent 1be7d1d commit ee0a4d6

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

Tests/Constraints/UniqueValidatorTest.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -246,14 +246,14 @@ public static function getInvalidFieldNames(): array
246246
/**
247247
* @dataProvider getInvalidCollectionValues
248248
*/
249-
public function testInvalidCollectionValues(array $value, array $fields)
249+
public function testInvalidCollectionValues(array $value, array $fields, string $expectedMessageParam)
250250
{
251251
$this->validator->validate($value, new Unique([
252252
'message' => 'myMessage',
253253
], fields: $fields));
254254

255255
$this->buildViolation('myMessage')
256-
->setParameter('{{ value }}', 'array')
256+
->setParameter('{{ value }}', $expectedMessageParam)
257257
->setCode(Unique::IS_NOT_UNIQUE)
258258
->assertRaised();
259259
}
@@ -264,23 +264,25 @@ public static function getInvalidCollectionValues(): array
264264
'unique string' => [[
265265
['lang' => 'eng', 'translation' => 'hi'],
266266
['lang' => 'eng', 'translation' => 'hello'],
267-
], ['lang']],
267+
], ['lang'], 'array'],
268268
'unique floats' => [[
269269
['latitude' => 51.509865, 'longitude' => -0.118092, 'poi' => 'capital'],
270270
['latitude' => 52.520008, 'longitude' => 13.404954],
271271
['latitude' => 51.509865, 'longitude' => -0.118092],
272-
], ['latitude', 'longitude']],
272+
], ['latitude', 'longitude'], 'array'],
273273
'unique int' => [[
274274
['id' => 1, 'email' => 'bar@email.com'],
275275
['id' => 1, 'email' => 'foo@email.com'],
276-
], ['id']],
276+
], ['id'], 'array'],
277277
'unique null' => [
278278
[null, null],
279279
[],
280+
'null',
280281
],
281282
'unique field null' => [
282283
[['nullField' => null], ['nullField' => null]],
283284
['nullField'],
285+
'array',
284286
],
285287
];
286288
}

0 commit comments

Comments
 (0)